home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / iso9660 / mail / pine / pine.not < prev    next >
Encoding:
Text File  |  1992-07-15  |  121.7 KB  |  2,884 lines

  1.                             - Pine Technical Notes -
  2.  
  3.  
  4.                               Pine Technical Notes
  5.                              Version 3.0, July 1992
  6.  
  7.  
  8.  
  9.  
  10.                 Section I -- Installation, Design and Internals
  11.  
  12.  
  13.           Building and Installation
  14.  
  15.                Hopefully, by this time you've already built  Pine  and
  16.           tried  it  out.  If not, you should be able to do it without
  17.           too much trouble by picking the platform you want  to  build
  18.           it  for  and giving the command "./build xxx" where "xxx" is
  19.           the three letter abbreviation for the  platform  name.   The
  20.           list of these abbreviations is in the file "doc/pine-ports".
  21.           You must be in the root of the source tree when you give the
  22.           build command. If there's nothing in pine-ports for the sys-
  23.           tem you have, building Pine and Pico will be a little  or  a
  24.           lot more involved. The first thing to try is to pick a plat-
  25.           form you think is close and try it, for example a  different
  26.           version of the same operating system. If it doesn't work you
  27.           can try another.  Giving the command "./build clean" between
  28.           attempts  is a good idea. It makes sure you start the compi-
  29.           lation from scratch each time. If nothing  works  then  some
  30.           real  porting  will  have  to  be done.  See the sections on
  31.           bugs, porting and source code below.   The  source  code  is
  32.           about 4Mb and fully compiled it takes up 7-10Mb depending on
  33.           the platform. You can do it in less space if you build  Pine
  34.           and  Pico  by  hand  and delete .o files as you compile each
  35.           library.
  36.  
  37.  
  38.                When you're done building Pine  you  should  have  four
  39.           binaries  in  the  bin directory. If they didn't all compile
  40.           you may still be OK. The binary, imapd, is  only  needed  if
  41.           you  want to operate pine in client-server mode and mtest is
  42.           used mostly for testing imapd. The Pine binary is the mailer
  43.           and  the  Pico  binary  is  a stand alone text editor that's
  44.           similar to the message composer. Pico is not needed  to  run
  45.           Pine or vice versa.
  46.  
  47.  
  48.                Usually, all you need to do to install Pine and Pico is
  49.           to copy the pine and pico binaries from the bin directory to
  50.           the local system bin directory so they can be execute by all
  51.           users.  /usr/local/bin is most frequently used.  /usr/bin is
  52.           also a possible place but they will get mixed in  with  your
  53.           standard system programs if you put them there. All the help
  54.           text is compiled into Pine so there are no required  auxili-
  55.           ary files.
  56.  
  57.  
  58.  
  59.                                      - 1 -
  60.  
  61.                             - Pine Technical Notes -
  62.  
  63.  
  64.                There  are  however,  two  optional  auxiliary   files:
  65.           /usr/local/lib/pine.info  and  /usr/local/lib/pine.conf. The
  66.           first one is can contain text on how to get further help  on
  67.           the  local system.  It is presented as the first page of the
  68.           help text for the main menu and should probably refer to the
  69.           local  help  desk  or the system administrator. If this file
  70.           doesn't exist a suitably generic text is  shown  (that  sug-
  71.           gests  sending  mail  to  root  as one way to get help). The
  72.           other file is used to configure the 2 0 or so  options  that
  73.           Pine  has.   See  the section on configuration in this docu-
  74.           ment.
  75.  
  76.           Here's a step by step recipe:
  77.  
  78.  
  79.           1.   Figure out what platform you're building Pine for.  You
  80.                can give the command "./build help" to get a short list
  81.                of platforms. If it's not in that list you can look  in
  82.                the   file   doc/pine-ports  (give  the  command  "more
  83.                doc/pine-ports" to view it). What you need is the three
  84.                letter  code  for the platform. Some examples are "nxt"
  85.                for a NeXT cubes and slabs and "ult" for Ultrix.
  86.  
  87.  
  88.           2.   Make sure your in the root of the pine source. When you
  89.                type "ls" you should see the following files and direc-
  90.                tories:
  91.  
  92.                    README    build     contrib   imapd     pico
  93.                    bin       c-client  doc       makefile  pine
  94.  
  95.  
  96.  
  97.  
  98.           3.   You can make sure you're getting a clean start by  giv-
  99.                ing the command "./build clean". This should take a few
  100.                seconds to run.
  101.  
  102.  
  103.           4.   Give the command "./build xxx" where "xxx" is the three
  104.                letter  code  you picked in step 1. The compiler should
  105.                grind away for 10 minutes or so. You shouldn't see  any
  106.                compiler warnings or errors, though there might be some
  107.                if your system doesn't match the system  you've  speci-
  108.                fied to build.
  109.  
  110.  
  111.           5.   When the compilation is complete the sizes of the  four
  112.                binaries  built  will be displayed. The binaries are in
  113.                the source directories with links to the  binaries  are
  114.                in  the "bin" directories. You can just get them out of
  115.                "bin".
  116.  
  117.  
  118.  
  119.                                      - 2 -
  120.  
  121.                             - Pine Technical Notes -
  122.  
  123.  
  124.           Design goals
  125.  
  126.  
  127.                 Pine  was  designed  for  novice  computer  users.  To
  128.           achieve  this,  features included were limited and carefully
  129.           selected.  This may have made Pine less attractive for power
  130.           users,  but  the  assumption  was that there were many power
  131.           user e-mail tools available for UNIX systems. It seemed very
  132.           important  to carefully consider questions that users asked.
  133.           Advanced users are articulate about the changes  they  would
  134.           like.   Beginning users are not articulate and may walk away
  135.           confused, not commenting if a program doesn't work  out  for
  136.           them.  Thus, if one continues development of a program based
  137.           on users comments one may wind up  with  something  suitable
  138.           for  advanced  users, but lose the beginning users.  To keep
  139.           to the design goals, the questions users  asked  about  Pine
  140.           were  examined  to  determine  the areas that weren't clear.
  141.           That is, when a user asked a question it  was  assumed  that
  142.           Pine  could  be  clearer about the way it worked rather than
  143.           assuming the user didn't understand.
  144.  
  145.  
  146.                Some other principles are:
  147.  
  148.            - The underlying model presented to the user has to be sim-
  149.           ple  and  clear.  To  this  end a lot of UNIX is hidden. For
  150.           example, there is a simple list of folders without hierarchy
  151.           and pathnames.
  152.  
  153.            - It's better to have a  few  general,  easily  understood,
  154.           commands that can be repeated than to have some more sophis-
  155.           ticated command that will do the job all at  once.  This  is
  156.           one reason Pine has no aggregate operations.
  157.  
  158.            - When ever the user has to select a  command,  file  name,
  159.           address  etc,  the user is given a menu or can get a menu to
  160.           make the selection from.  If possible the menu  is  as  com-
  161.           plete  as  possible  (no  hidden  commands),  small and well
  162.           thought out. This isn't entirely possible with  things  like
  163.           addresses, but the address book helps.
  164.  
  165.            - Pine provides immediate feed back for the user with  each
  166.           operation.
  167.  
  168.            - The system should be very tolerant  of  user  errors.  It
  169.           should  warn  him if he's about do to something irreversible
  170.           or provide a way to undo something. This way  the  user  can
  171.           learn  by exploration with out fear of doing anything wrong.
  172.           This is an important feature so the  user  can  get  started
  173.           quickly without reading any manuals and so fewer manuals are
  174.           required. (At the moment there isn't any manual anyway).
  175.  
  176.            - The size of the system should be kept small so  the  user
  177.  
  178.  
  179.                                      - 3 -
  180.  
  181.                             - Pine Technical Notes -
  182.  
  183.  
  184.           doesn't  feel like there are all these commands and concepts
  185.           that he should know while using the system.
  186.  
  187.  
  188.           IMAP (The Interactive Mail Access Protocol)
  189.  
  190.  
  191.                Pine is capable of operating as  an  IMAP  client.  The
  192.           syntax  for  naming  an  IMAP  mailbox is {hostname}mailbox.
  193.           Hostname is a standard DNS hostname and mailbox is the  path
  194.           of  the mail file to be opened. It may be "inbox" to specify
  195.           the systems idea of the inbox, or it may be a file path name
  196.           relative   to   the   users   home  directory.  For  example
  197.           "mail/sent-mail". The remote host must be running  an  imapd
  198.           and the user will be required to authenticate himself with a
  199.           user name and password.
  200.  
  201.  
  202.                If "rimap" authentication is enabled on the remote host
  203.           an  .rhosts file on the server will allow the user to bypass
  204.           typing the password.  This works by having  the  client  use
  205.           the  standard  rsh  mechanism to connect to the server which
  206.           results in two extra rsh processes on the client.  Basically
  207.           what  is  happening here is that Pine is taking advantage of
  208.           the ability that rsh has to use privileged TCP ports  so  it
  209.           doesn't  have  to  run  in  privileged  mode. If the "rimap"
  210.           authentication fails it will drop  back  to  plain  password
  211.           authentication.  Enabling  "rimap" authentication is done by
  212.           creating a link called rimapd to imapd.
  213.  
  214.  
  215.                Installing imapd requires placing  the  binary  in  the
  216.           appropriate  directory,  usually /usr/etc and adding entries
  217.           to /etc/services and /etc/inetd.conf. The following line  is
  218.           appropriate for /etc/services:
  219.  
  220.             imap         143/tcp         # Mail transfer
  221.  
  222.           and this next line is appropriate for /etc/inetd.conf:
  223.  
  224.             imap  stream  tcp     nowait  root    /usr/etc/imapd imapd
  225.  
  226.           The /etc/inetd.conf file entry may vary  on  different  ver-
  227.           sions  of  UNIX.   Some  have  a  slightly  different set of
  228.           fields. Also the path name in /etc/inetd.conf must match the
  229.           path where imapd is installed.
  230.  
  231.  
  232.                At this point one may ask, what is IMAP and why  is  it
  233.           useful?  A  complete  answer would be fairly long. Basically
  234.           IMAP is a mail access protocol as distinguished from a  mail
  235.           transfer  protocol.   It's  intended  for  interactive  mail
  236.           access. It's closest kin is POP, the Post  Office  Protocol,
  237.  
  238.  
  239.                                      - 4 -
  240.  
  241.                             - Pine Technical Notes -
  242.  
  243.  
  244.           but  it  exceeds POP in many ways. POP works by transferring
  245.           an entire mailbox to the client where all the mail is  kept.
  246.           IMAP retains all mail on the server and allows the client to
  247.           retrieve mail as it's read and then send  commands  back  to
  248.           the  server to specify what is to be done with the mail. The
  249.           advantages of this is that it works well over low  bandwidth
  250.           lines  because  only what's needed is transferred, then mail
  251.           is cached on the client. However, POP is  appropriate  where
  252.           connect  time charges are high. Other advantages of IMAP are
  253.           that the mail is stored on a reliable,  always  up,  server;
  254.           that the mail can be accessed from many different clients in
  255.           different places and is not stuck on a PC (probably with  no
  256.           backups);  and  that  it  allows  one  to  take advantage of
  257.           cheaper CPU cycles on the desk top to drive the user  inter-
  258.           face  rather than expensive cycles on time sharing machines.
  259.           One imap client can also be  used  to  access  several  mail
  260.           servers at once. The general idea is to run a mail client on
  261.           the machine where a user has his home directory, to  facili-
  262.           tate  moving  information between the mail system and user's
  263.           file system, but to deliver mail to and maintain one's inbox
  264.           on a high availability server.
  265.  
  266.  
  267.                Currently, Pine supports having one's inbox remote  via
  268.           IMAP.  This  feature  is  invoked  by entering a {host}inbox
  269.           value for the inbox-path option either the global pine  con-
  270.           figuration  file or in a users .pinerc file. Access to other
  271.           remote folders require the users to type the full IMAP  mail
  272.           box  specification.   Future plans include simpler access to
  273.           remote folders other than inbox.
  274.  
  275.  
  276.                Some other sources  of  information  are  RFC-1176  and
  277.           imap-viewgraphs.ps  included  here.  You  can also fetch the
  278.           whole   imap   source   tree   and   developers   kit   from
  279.           ftp.cac.washington.edu.  The  IMAP protocol and the c-client
  280.           library that implements it are authored by Mark Crispin.
  281.  
  282.  
  283.           Address Formats (RFC-822 Compliance)
  284.  
  285.  
  286.                Pine tries to adhere to RFC-822 a little more  strongly
  287.           than  some  other mailers and uses the "full name <address>"
  288.           format rather than the "address  (full  name)"  format.  The
  289.           intent  of  the standard is that items in parenthesis should
  290.           only be for comments.  Pine displays and generates the newer
  291.           format,  but  will parse the old format and turn it into the
  292.           new one.
  293.  
  294.  
  295.                Pine also fully qualifies  all  addresses  on  outgoing
  296.           mail  with  the  host  or  domain  name  as described in the
  297.  
  298.  
  299.                                      - 5 -
  300.  
  301.                             - Pine Technical Notes -
  302.  
  303.  
  304.           section on domain names. This makes addresses more clear and
  305.           unambiguous  as  networks  get  larger and span greater dis-
  306.           tances and gives a hint to the user that the network extends
  307.           beyond  the  local organization.  Typing the fully qualified
  308.           address is not required, just the user name  is  sufficient.
  309.           When  the  user moves the cursor out of the header field the
  310.           address will be expanded and  fully  qualified.   Note  that
  311.           because  the  newer  format  is used, commas are required to
  312.           separate addresses since the full name part may have  spaces
  313.           in  it.   If  any  special  characters as defined in RFC-822
  314.           appear in the full name,  quotes  are  required  around  the
  315.           address.  Pine  will  insert  them automatically. The common
  316.           cases where this happens are with periods after initials and
  317.           parentheses.  A  good  substitute  for parentheses are curly
  318.           braces. They are not considered special.
  319.  
  320.  
  321.                On some UUCP connected machines and for UUCP addresses,
  322.           fully  qualified  addresses  may  seem  to  confuse or break
  323.           things. This is probably not the case  though,  because  the
  324.           local  hostname  is what is added. The mailer will recognize
  325.           it as the local hostname and drop  that  part  first  before
  326.           going on to process the rest of the address.
  327.  
  328.  
  329.                Pine also expects dates to be in the  standard  RFC-822
  330.           format which is something like:
  331.  
  332.             [www, ] dd mmm yy hh:mm[:ss] [timezone]
  333.  
  334.           It will attempt to parse dates that are not in this  format.
  335.           When  an  unparsable  date is encountered it is displayed as
  336.           "xxx xx" when shown in the index.
  337.  
  338.  
  339.           Known Bugs and Problems
  340.  
  341.  
  342.                 In general, see the to-do-xxxx file included with this
  343.           documentation.   At  the  U.W.  Pine  is used by 3,000 users
  344.           every week, most of the bugs have been  shaken  out  of  it,
  345.           though  the  MIME  code is new and has not been heavily used
  346.           yet.
  347.  
  348.  
  349.           Domain names
  350.  
  351.  
  352.                Pine needs to know the full host and domain name of the
  353.           site it is running on.
  354.  
  355.           (Domain names are a feature of the Internet and are used  to
  356.           uniquely  name each host on the network. A domain name has a
  357.  
  358.  
  359.                                      - 6 -
  360.  
  361.                             - Pine Technical Notes -
  362.  
  363.  
  364.           number of parts separated by periods. Each part represents a
  365.           level in the hierarchy. An example of a name is
  366.  
  367.                     "olive.cac.washington.edu"
  368.  
  369.           In this name the top level is "edu", indicating it  is  part
  370.           of an educational institution; the second level is "washing-
  371.           ton" indicating the University of  Washington;  "cac"  is  a
  372.           specific  department;  and  "olive" is the hostname. The top
  373.           level names are  assigned  by  Internet  organizations,  and
  374.           other  names  are  assigned  at  the appropriate level.  The
  375.           Domain Name Service, DNS, or named on UNIX  systems  is  the
  376.           distributed  data base used to look up these names. The file
  377.           /etc/hosts usually sets the name of the local host.  If  you
  378.           are  not  on  the Internet or other network you can probably
  379.           just use a single part hostname)
  380.  
  381.  
  382.                Pine determines the domain name it uses as follows.  If
  383.           no   settings   are   made   in  the  users  .pinerc  or  in
  384.           /usr/local/lib/pine.conf then it uses the domain name looked
  385.           up  from  the  system. This usually comes out of /etc/hosts,
  386.           DNS or  the  local  configuration  data  base  (e.g.  Yellow
  387.           Pages).  If  this  look up fails and there are no other set-
  388.           tings Pine will exit with the error message "No host name or
  389.           domain name set."
  390.  
  391.           Often it happens that the domain name that  Pine  gets  from
  392.           the  hostname  lookup is not the fully qualified domain name
  393.           because of the way the /etc/hosts file is set up. When  this
  394.           occurs Pine cannot fully qualify the addresses it sends out.
  395.           It isn't essential that the name be fully qualified, but  it
  396.           is  highly  desirable because it can avoid some mail routing
  397.           problems. In some cases  sendmail  will  fully  qualify  the
  398.           addresses  as  it's  delivering  the mail. Specifically, the
  399.           problem is because the entry in  /etc/hosts  for  the  local
  400.           system  has  the unqualified name first and the fully quali-
  401.           fied name following as an alias as follows:
  402.  
  403.               128.95.112.99   olive.cac.washington.edu   olive
  404.  
  405.                           is preferred over
  406.  
  407.               128.95.112.99   olive   olive.cac.washington.edu
  408.  
  409.  
  410.  
  411.                The domain name may be set explicitly with  the  "user-
  412.           domain"   variable   in   either   the   user   .pinerc   or
  413.           /usr/local/lib/pine.conf. If set in /usr/local/lib/pine.conf
  414.           it  affects all Pine users on the system. This setting over-
  415.           rides the system setting.
  416.  
  417.  
  418.  
  419.                                      - 7 -
  420.  
  421.                             - Pine Technical Notes -
  422.  
  423.  
  424.                At the University of Washington an effort has been made
  425.           to encourage host-less addresses so that users may move from
  426.           one host to another without changing there e-mail addresses.
  427.           This  usually  requires some sort of data base at the domain
  428.           level to direct the mail to a particular host. In place of a
  429.           data base, all mail could be directed at one host. To facil-
  430.           itate this you can set the "use-only-domain-name" to  "yes",
  431.           and Pine will strip off the host part of the address. In the
  432.           example   above,   the   host-less    address    would    be
  433.           "cac.washington.edu".   This stripping is achieved by remov-
  434.           ing the first part of what is assumed to be the  full  host-
  435.           name.  The  removal  of the host part is only applied to the
  436.           full hostname looked up from the system and not to  the  one
  437.           set by the "user-domain" variable.
  438.  
  439.  
  440.                Once the domain name is determined, Pine  uses  it  for
  441.           qualifying  all  unqualified  outgoing  addresses and in the
  442.           From: in outgoing mail.  It is also used to determine if  an
  443.           address is that of the current Pine user. The full host name
  444.           is also used in the internal message ID.
  445.  
  446.  
  447.  
  448.  
  449.           Pine Configuration (system wide and per user)
  450.  
  451.  
  452.                There are two configuration files in Pine:  the  system
  453.           wide  configuration  file, /usr/local/lib/pine.conf; and the
  454.           per user configuration file,  .pinerc  in  each  users  home
  455.           directory. The syntax of the variables or options in them is
  456.           the same. In a number of cases the variables  are  the  same
  457.           too. The syntax is:
  458.  
  459.               <variable> = <value>
  460.  
  461.           If the value is absent then the variable is unset. To set  a
  462.           variable  to the empty value the syntax is "". Quotes may be
  463.           used around any value.  All values are strings  and  end  at
  464.           the  new  line  or  the closing quote.  Leading and trailing
  465.           space is ignore unless it is included  in  the  quotes.  For
  466.           some  variables  the  only  appropriate values are "yes" and
  467.           "no". If a variable is set in the system configuration  file
  468.           and  the  per  user configuration file, the per user setting
  469.           takes precedence. If a local variable is unset (usually  the
  470.           case  for  most  variables) the system value is used. If the
  471.           system value is unset then the compiled in default value  is
  472.           used.
  473.  
  474.  
  475.                Both files may contain comments which are lines  begin-
  476.           ning  with  a  "#".   You may get a sample/fresh copy of the
  477.  
  478.  
  479.                                      - 8 -
  480.  
  481.                             - Pine Technical Notes -
  482.  
  483.  
  484.           system configuration  file  by  running  "pine  -conf".  The
  485.           result  will be printed on the standard output with comments
  486.           describing each variable. All  the  possible  variables  are
  487.           included  in  this.  The best thing to do is create the file
  488.           initially with this command and then edit in the values  you
  489.           want to set. Pine will run fine without this file.
  490.  
  491.  
  492.                References  to  UNIX  environment  variables   may   be
  493.           included  in  the  pine  configuration  file.  The format is
  494.           "$variable" or "${variable}".  The  character  "~"  will  be
  495.           expanded to the $HOME environment variable.
  496.  
  497.  
  498.                Pine will automatically create  the  per  user  .pinerc
  499.           file  the  first  time  it is run. It will write entries for
  500.           each variable with comments so one knows what all the possi-
  501.           ble  variables  are  by just looking in the file. Pine reads
  502.           and writes  the  .pinerc  file  occasionally  during  normal
  503.           operation  as  state,  like  the  printer  configuration, is
  504.           changed. Any comments or additional lines in the  file  will
  505.           be carried along as the file is rewritten. This will guaran-
  506.           tee backward compatibility with old versions  as  new  vari-
  507.           ables  are  added  to  subsequent  versions of Pine. It also
  508.           allows the user to put additional comments in  the  .pinerc.
  509.           Pine  always  writes this file at least once when running so
  510.           you can tell when a user last invoked Pine by  the  date  on
  511.           this  file.  This is how the pine-use program (which you can
  512.           compile and use) counts up the current Pine users.
  513.  
  514.  
  515.                Currently, most of these variables have to  be  set  by
  516.           hand  with  an  editor.  Eventually it would be nice if Pine
  517.           had a user interface to set these  variables  so  the  users
  518.           don't  have to venture out with a text editor. It's intended
  519.           that only experienced users make settings with  the  current
  520.           scheme.
  521.  
  522.           Descriptions of the variables:
  523.  
  524.  
  525.           user-id
  526.                This is disabled for time sharing machines, but may  be
  527.                used on versions for PCs.
  528.  
  529.  
  530.           personal-name
  531.                Your full personal name. Normally this  is  taken  from
  532.                the  accounts  data  base (/etc/passwd) on most systems
  533.                and doesn't need to be set, but you can over  ride  the
  534.                systems  idea  of  who  you are with this. This is only
  535.                appropriate in the user .pinerc
  536.  
  537.  
  538.  
  539.                                      - 9 -
  540.  
  541.                             - Pine Technical Notes -
  542.  
  543.  
  544.           printer
  545.                This is the current setting for a users  printer.  It's
  546.                usually  the  same  value  as the standard-printer, the
  547.                personal-print-command or "attached-to-ansi". The value
  548.                of  this in the system configuration file specifies the
  549.                default value if users don't set their own. The setting
  550.                of  this  variable  is  done  by  the printer selection
  551.                screen in Pine.
  552.  
  553.  
  554.           standard-printer
  555.                Specifies the command for printer selection number 2 on
  556.                the printer menu. This is only in the system configura-
  557.                tion file.
  558.  
  559.  
  560.           personal-print-command
  561.                Only in the per user configuration. This corresponds to
  562.                item  3  in the printer menu. This variable retains the
  563.                personal-print-command when the printer is set to some-
  564.                thing other than item 3.
  565.  
  566.  
  567.           last-time-prune-questioned
  568.                Despite it's silly  name,  this  variable  records  the
  569.                month  the user was last asked if his sent-mail folders
  570.                should be pruned. The format is yy.mm. This is automat-
  571.                ically  updated by Pine when the the pruning is done or
  572.                declined. This is only in the per user configuration.
  573.  
  574.  
  575.           user-domain
  576.                Sets the domain or host name for the  user,  overriding
  577.                the  system  host  or  domain name. See the domain name
  578.                section. This can be set for the whole system  and  for
  579.                each user.
  580.  
  581.  
  582.           use-only-domain-name
  583.                Can be set to "yes" or "no". At this point anything but
  584.                "yes"  means  "no",  except when it is unset. If set to
  585.                yes one part of the hostname will be lopped off to  get
  586.                the  domain  name  and the domain name will be used for
  587.                outgoing mail and such. That is,  if  the  hostname  is
  588.                "milton.u.washington.edu"  and  this variable is set to
  589.                "yes", then "u.washington.edu" will be used on outgoing
  590.                mail.  This  can  be  set  for the whole system and per
  591.                user.
  592.  
  593.  
  594.           inbox-path
  595.                This specifies the name of the folder to  use  for  the
  596.                inbox.  Normally  this is unset so the system's default
  597.  
  598.  
  599.                                      - 10 -
  600.  
  601.                             - Pine Technical Notes -
  602.  
  603.  
  604.                is used. The most common setting of this is to open  an
  605.                IMAP    mailbox    for    the    inbox.   For   example
  606.                "{marge.cac.washington.edu}inbox" will open the  user's
  607.                standard  inbox  on the mail server, marge. This can be
  608.                set per user and for the whole system.
  609.  
  610.  
  611.           elm-style-save
  612.                Setting this to  "yes"  will  cause  Pine  to  generate
  613.                default  folder  names  when saving messages similar to
  614.                the way elm does. The folder  will  be  named  for  the
  615.                username  of the sender of the message. This can be set
  616.                per user and for the whole system.
  617.  
  618.  
  619.           header-in-reply
  620.                This governs whether or not the header of the  original
  621.                message is included when including the original text of
  622.                a message in a reply.  This can be set per user and for
  623.                the whole system.
  624.  
  625.  
  626.           default-fcc
  627.                The name of the folder to which all outgoing mail  goes
  628.                is set here. The compiled-in default is "sent-mail". It
  629.                can be set to "" to turn off saving copies of  outgoing
  630.                mail and can be set on a per user or system wide basis.
  631.  
  632.  
  633.           bugs-nickname, bugs-fullname and bugs-address
  634.                These can only be set for the whole system  and  speci-
  635.                fies  an  entry  for  the  address  book that is always
  636.                inserted if found absent.  It  is  a  way  to  put  the
  637.                address  to  send  requests  for  help to in everyone's
  638.                address book so users can find it easily.
  639.  
  640.  
  641.           smtp-server
  642.                When this variable is set to a host name or IP  address
  643.                Pine  will  try to drop off outgoing mail to the speci-
  644.                fied host via SMTP instead of sending it by passing  it
  645.                off to sendmail.
  646.  
  647.  
  648.           editor
  649.                Sets the name of the  alternate  editor  for  composing
  650.                mail. It will be invoked with the "^_" command.
  651.  
  652.  
  653.           image-viewer
  654.                This variable names the program to call for  displaying
  655.                parts  of a MIME messages that are of type image. It is
  656.                usually set to xloadimage or xv. In a future version of
  657.  
  658.  
  659.                                      - 11 -
  660.  
  661.                             - Pine Technical Notes -
  662.  
  663.  
  664.                Pine  this  configuration  will be replaced by the more
  665.                general "mailcap".
  666.  
  667.  
  668.  
  669.           feature-level
  670.                This controls the user level for Pine. It may be set to
  671.                "seedling" for novice users, "sapling" for intermediate
  672.                users and "old-growth" for advanced users. In Pine  3.0
  673.                there  is  no  difference  between seedling and sapling
  674.                modes, and old-growth just adds the "H" command to view
  675.                the full header and allows the "^_" command in the com-
  676.                poser to invoke an alternate editor.
  677.  
  678.  
  679.           old-style-reply
  680.                Setting this to  "yes"  will  cause  the  signature  to
  681.                appear  at  the end of the original, included text in a
  682.                reply instead of at the beginning. See details  in  the
  683.                section on replying and signatures.
  684.  
  685.  
  686.           signature-file
  687.                Names the file to be included as  the  signature.  This
  688.                defaults to ".signature".
  689.  
  690.  
  691.           mail-directory
  692.                Use this to change the subdirectory that Pine puts  its
  693.                mail files in.  The default is "mail".
  694.  
  695.  
  696.           character-set
  697.                This sets the  character  set  used  by  the  terminal.
  698.                Currently  appropriate  values  are  US-ASCII  and ISO-
  699.                8859-1 through ISO-8859-9. See the section on character
  700.                sets for more details. The default is US-ASCII.
  701.  
  702.  
  703.           show-all-characters
  704.                If this is set to yes, Pine will display all 8 bits  of
  705.                any text received, regardless of whether it matches the
  706.                character set currently in use.
  707.  
  708.  
  709.           new-version
  710.                If this is on, a message explaining that this is a  new
  711.                version  of Pine will be given. In Pine 3.02 this is on
  712.                by default and should be set to "no" to turn  off  this
  713.                message.
  714.  
  715.  
  716.  
  717.  
  718.  
  719.                                      - 12 -
  720.  
  721.                             - Pine Technical Notes -
  722.  
  723.  
  724.           Mail folder reading, writing, locking and check pointing
  725.  
  726.  
  727.                All mail files (folders) are read and  written  by  the
  728.           c-client library. Extensive effort has gone into making this
  729.           as robust as possible. The c-client provides locking against
  730.           several  user  having  a  mail  file  open at once.  This is
  731.           beyond the usual UNIX locking which just guarantees that two
  732.           processes  won't  write  the  file  at the same time and are
  733.           known as "MRC" locks, named after Mark Crispin.  The  second
  734.           user  that attempts to open the folder with Pine will get it
  735.           opened read-only.  Because there is generally no such  lock-
  736.           ing  convention on UNIX platforms this additional locking is
  737.           only effective  against  multiple  uses  of  Pine  or  other
  738.           mailers using the c-client such as MailManager, ms and a few
  739.           others. Berkeley mail(1), elm, mh and such will be  able  to
  740.           open  the  mail  folder  when Pine has it open.  If the mail
  741.           file changes on the disk underneath Pine  or  the  c-client,
  742.           they  will  give up on the mail file and close it. Pine also
  743.           checkpoints the mail file every so often  depending  on  how
  744.           many  changes  have been made and how long it has been since
  745.           the last change. This minimizes the potential for loss.
  746.  
  747.  
  748.                With Berkeley format mail files, there are three modif-
  749.           ication  operations done to mail folders: appending new mes-
  750.           sages, rewriting the file to delete messages  and  rewriting
  751.           to  changes  status  flags.  Appending messages is a special
  752.           case and doesn't threaten the integrity of the mail  already
  753.           in  the  file. If an append can't be completed for some rea-
  754.           son, such as a full disk, the whole append  is  aborted  and
  755.           the  mail file left as is. When rewriting the mail file more
  756.           care has to be taken. What the c-client, and therefore Pine,
  757.           does is first calculate how much the mail file would grow if
  758.           all the status flags were inserted in  their  longest  form.
  759.           Then the mail file is extended by that amount, writing nulls
  760.           past the end of the file to be sure there's room on the disk
  761.           and  to reserve the space. If the extend was successful, the
  762.           mail file is rewritten over the existing data without  trun-
  763.           cating  the file. This is to make sure the disk space origi-
  764.           nally occupied by the mail file is not consumed by some  run
  765.           away disk-block-eating process.
  766.  
  767.  
  768.                The extended locking works by creating  lock  files  in
  769.           /tmp  of  the  form  ".\usr\spool\mail\joe". Flock() is then
  770.           used on these files; their existence does not  constitute  a
  771.           lock.  This  lock  is  created when the folder is opened and
  772.           destroyed when it is closed. When  the  folder  is  actually
  773.           being  written the standard Berkeley locks are also created.
  774.           One could say the Berkeley  locks  are  created  within  the
  775.           other  locks.   This  way  new mail can be delivered into an
  776.           open folder.
  777.  
  778.  
  779.                                      - 13 -
  780.  
  781.                             - Pine Technical Notes -
  782.  
  783.  
  784.                If a mail file is modified underneath of Pine while  it
  785.           has it open, Pine will give up on that mail file, concluding
  786.           it's best not to do any further reads or  writes.  This  can
  787.           happen  if  another mailer that doesn't obey MRC locks (e.g.
  788.           elm, or mail) is run while Pine has the mail folder open.
  789.  
  790.  
  791.                Pine can read and write mail files via NFS, but IMAP is
  792.           preferred.   Some modifications have been made to the way it
  793.           operates on the mail files to make things work  better  with
  794.           NFS,  but  they are not guaranteed to work with all versions
  795.           of NFS or as reliable as writing to a standard file  system.
  796.           See the NFS section for more details.
  797.  
  798.  
  799.           Terminals and Termcap
  800.  
  801.  
  802.                Pine has been designed to require as little as possible
  803.           from  the terminal. It uses termcap or terminfo depending on
  804.           how it was compiled. At the  minimum  Pine  requires  cursor
  805.           positioning,  clear to end of line and inverse video. Unfor-
  806.           tunately there are terminals that are missing some of  these
  807.           such  as a vt52. Pine makes no assumptions as to whether the
  808.           terminal wraps or doesn't wrap. If the  terminal  has  other
  809.           capabilities  it will use them. Pine won't run well on older
  810.           terminals that require a space on the screen to change video
  811.           attributes  such  as  the  Televideo 925. One can get around
  812.           this on some terminals by using "protected field" mode.  The
  813.           terminal  can  be made to go into protected mode for reverse
  814.           video, and then reverse video is assigned to protected mode.
  815.  
  816.  
  817.                Pine handles screens of most any size and  resizing  on
  818.           the fly. It catches SIGWINCH and does the appropriate thing.
  819.           A screen one line high will display only the new mail notif-
  820.           ication.  Screens  that are less than ten columns wide don't
  821.           format very nicely or work  well,  but  will  function  fine
  822.           again  once resized to something large. There is an internal
  823.           maximum screen size, currently 170 columns by 200  rows.  If
  824.           the  screen  is  made bigger than it, the whole screen won't
  825.           all be used.  These maximum values are set in  os-xxx.h  and
  826.           can  be  changed,  but  increasing them will increase memory
  827.           usage.
  828.  
  829.  
  830.           Memory Usage
  831.  
  832.  
  833.                The current Pine/C-client architecture isn't  the  most
  834.           efficient  in  it's  memory  use. It reads in the whole mail
  835.           folder as it's parsing it.  It also makes  in-memory  copies
  836.           of  messages  as  they  are forwarded, saved and such, so it
  837.  
  838.  
  839.                                      - 14 -
  840.  
  841.                             - Pine Technical Notes -
  842.  
  843.  
  844.           doesn't operate very efficiently on messages over  1Mb,  but
  845.           normal  operation  is OK. Some work has been done already to
  846.           ameliorate the situation and more is possible.
  847.  
  848.  
  849.           Sendmail, SMTP and mail delivery
  850.  
  851.  
  852.                Pine submits outgoing mail either to sendmail or to  an
  853.           SMTP  server  for  delivery.  When using sendmail, it writes
  854.           the message to a temporary file in /tmp.   Then  it  runs  a
  855.           shell  in  the background that runs sendmail on the file and
  856.           removes the file. It's done with a shell in  the  background
  857.           so  the  user  doesn't  have to wait for sendmail to finish.
  858.           Sendmail is invoked with the "-t" flag to cause it  to  read
  859.           and parse the header to determine the recipients; the "-oem"
  860.           flag to cause errors to be mail back; and the "-oi" flag  to
  861.           ignore  dots  in  incoming  messages.  (The dots are used to
  862.           indicate things such as the end of the message).
  863.  
  864.  
  865.                To make Pine operate as an SMTP client, the smtp-server
  866.           variable  can  be  set  to the IP address or hostname of the
  867.           SMTP server. When a message is sent Pine will post the  mes-
  868.           sage  directly to the SMTP server. This is particularly use-
  869.           ful with Pine running on UNIX workstations with IMAP because
  870.           it saves having to configure sendmail on the workstation. It
  871.           is also essential for the DOS  version  since  there  is  no
  872.           alternative to SMTP.
  873.  
  874.  
  875.  
  876.           The Berkeley Mail file format and locking
  877.  
  878.  
  879.                Here are the grungy details on how  the  Berkeley  mail
  880.           file  format works. This format comes to us from the ancient
  881.           UNIX mail program, /bin/mail. This program was actually used
  882.           to interactively read mail at one time, and is still used on
  883.           some systems as the local delivery agent.  The  messages  in
  884.           the file are separated by lines of the following format:
  885.  
  886.           "From user-name WWW MMM DD HH:MM:SS YYYY\n"
  887.  
  888.           "User-name" is from the envelope and the date is as  printed
  889.           out by ctime(). This separator must be at the beginning of a
  890.           line and should have a blank line before it. The  mail  file
  891.           usually ends in "0. Because of the format of the separators,
  892.           no lines in the mail message can begin with "From  ",  space
  893.           included,  so  they  are modified to be ">From ". You'll see
  894.           this occasionally in mail messages. The date is the date the
  895.           message  was  first  received and should be carried along if
  896.           the message is copied to  another  folder.  This  format  is
  897.  
  898.  
  899.                                      - 15 -
  900.  
  901.                             - Pine Technical Notes -
  902.  
  903.  
  904.           antiquated and should be replaced!
  905.  
  906.  
  907.                There are two kinds of locking that are commonly  done.
  908.           The older form creates a "xxxx.lock" file in /usr/spool/mail
  909.           to lock the mail box "xxxx". This makes use of the fact  the
  910.           directory  operations  are  atomic  in  UNIX. It also mostly
  911.           works across NFS. There  are  involved  algorithms  used  to
  912.           determine  if  a lock is held and should be broken.  Usually
  913.           the calculation takes into account the load on the system.
  914.  
  915.  
  916.                The other locking scheme uses the flock()  system  call
  917.           on  the  mail box. This is much more efficient and the locks
  918.           can't get stuck because they go away when the  process  that
  919.           created  them  dies.  This  is  usually  found on 4.3bsd and
  920.           related machines.
  921.  
  922.  
  923.                These locks only control actual reading and writing  to
  924.           the  file.  When  new  mail is being delivered, messages are
  925.           being deleted or status being updated these locks are  used.
  926.           For  small  mail  files they should never be around for more
  927.           than a few seconds. This is normally the only  locking  used
  928.           for mail on UNIX mail system. The c-client/Pine extends this
  929.           locking to prevent multiple mail readers  from  opening  the
  930.           same  mail folder for modification twice. See the section on
  931.           "Reading, Writing, Checkpointing and Locking".
  932.  
  933.  
  934.           Accessing mail folders via NFS
  935.  
  936.                It is possible to access NFS mounted mail folders  with
  937.           Pine,  but  there  are  some drawbacks to doing this. One is
  938.           that the per folder "MRC" locks don't work because  /tmp  is
  939.           usually not shared, and even if it was, flock() doesn't work
  940.           across NFS. This is the lock added by Pine and not the stan-
  941.           dard UNIX mail file lock against writing.
  942.  
  943.                The implementation of the standard  UNIX  ".lock"  file
  944.           locking has been modified to work with NFS as follows. Stan-
  945.           dard hitching post locking is used: First a  uniquely  named
  946.           file      is     created.     Usually     something     like
  947.           "inbox.host.time.pid". Then a link to it  is  created  named
  948.           "inbox.lock" where the folder being locked is "inbox".  This
  949.           file constitutes the lock. This is a standard  UNIX  locking
  950.           scheme.  It works because the link(2) system call is atomic.
  951.           With NFS, link(2) is still  guaranteed  to  be  atomic,  but
  952.           packets can get lost and cause problems. The worst case hap-
  953.           pens when the link request makes it to the  server  and  the
  954.           link  is  actually  made  on the server, but the acknowledge
  955.           packet gets lost.  The  client  then  retransmits  the  link
  956.           request.  When  it arrives at the server, the server doesn't
  957.  
  958.  
  959.                                      - 16 -
  960.  
  961.                             - Pine Technical Notes -
  962.  
  963.  
  964.           know it's not a new request (NFS is stateless)  and  returns
  965.           saying  the link already exists, so the whole link operation
  966.           fails. The mail software will conclude the mailbox is locked
  967.           and that it should wait.
  968.  
  969.                This has been worked around by ignoring the return code
  970.           from  link(2).  After the link returns, a stat(2) is done on
  971.           the file. If the file has two links, it  is  concluded  that
  972.           the lock succeeded and it is safe to proceed.
  973.  
  974.  
  975.                Another problem occurs with data caching. On  many  NFS
  976.           implementations  the client will never see new data appended
  977.           to a file if the file is held open. Even a stat on the  file
  978.           will  not  reveal  the  new  file size or modification time.
  979.           This is quite  different  from  standard  UNIX  file  system
  980.           semantics.  To get around this, the c-client library reopens
  981.           the file every time it checks for new mail.
  982.  
  983.  
  984.                One last annoyance that hasn't been solved happens when
  985.           the  c-client  detects  a change in the modification time of
  986.           the mail file, but no change in the  size  of  the  file.  A
  987.           warning message is given to the user (which usually confuses
  988.           the users). Thus far this has only been an annoyance and not
  989.           actual problems with the mail file have been found.
  990.  
  991.  
  992.                In conclusion, it is mostly safe  to  access  mail  via
  993.           NFS.  The  main  problem  will  occur  when two users try to
  994.           access the same mail folder from different hosts.  When  the
  995.           second  user  writes  the file, Pine will get upset that the
  996.           file has been changed underneath of it and abort  operations
  997.           on  the  folder. Pine will continue to display mail from the
  998.           folder that it has in its internal cache, but  it  will  not
  999.           read nor write any further data. The only thing that will be
  1000.           lost out of the first session when this happens is the  last
  1001.           few deletion marks since the last checkpoint.
  1002.  
  1003.  
  1004.           MIME -- Multipart Internet Mail Extensions
  1005.  
  1006.  
  1007.                Using the MIME standard, Pine is able to  attach  arbi-
  1008.           trary  files  to mail messages. These files can be binaries,
  1009.           executables, spreadsheets, GIF, binhex, text  files  or  any
  1010.           other  sort.  The  receiver  of  the message will be able to
  1011.           detach the file exactly as it was sent.  MIME  messages  may
  1012.           also  include  sounds,  images  and  even video. Pine cannot
  1013.           display most of these formats, but  it  will  identify  each
  1014.           part  or  attachment  and  allow  that part to be saved in a
  1015.           file.
  1016.  
  1017.  
  1018.  
  1019.                                      - 17 -
  1020.  
  1021.                             - Pine Technical Notes -
  1022.  
  1023.  
  1024.                As of these notes for Pine 3.0,  MIME  is  a  very  new
  1025.           standard  and  Pine  is  one of the early implementations of
  1026.           MIME, thus many conventions aren't clear and we  have  prob-
  1027.           ably made some big mistakes. MIME is defined in RFC-1341 and
  1028.           is very soon expected to be accepted by the  Internet  agen-
  1029.           cies  as  an  Internet  standard. There are many other folks
  1030.           working on MIME implementations and we expect that it's  use
  1031.           will  become widespread on the Internet.  Generally, MIME is
  1032.           a way of encoding, in ASCII, a multipart message  structure.
  1033.           The parts may be nested and may be of seven different types:
  1034.           Text, Audio, Image, Video,  Message,  Application  and  Mul-
  1035.           tipart  (nested).  Provisions  are included for encoding any
  1036.           binary data in ASCII in a base 64 format similar to uuencode
  1037.           or  btoa.  MIME includes support for international character
  1038.           sets, tagging each part of a message with the character  set
  1039.           it is written in and providing 7 bit encoding of 8 bit char-
  1040.           acter sets. It also provides a simple "rich text" format for
  1041.           marking  text  as  bold,  underlined  and  such.  There is a
  1042.           mechanism for splitting messages  into  multiple  parts  and
  1043.           reassembling them at the receiving end.
  1044.  
  1045.  
  1046.                Pine is able to view and/or take apart just  about  any
  1047.           MIME message. It will display a list of all the parts, their
  1048.           types and sizes. All text parts will be shown unless  it  is
  1049.           not possible because of the character set. Rich text will be
  1050.           displayed in a very limited  way  (it  will  show  bold  and
  1051.           underlining).  Pine cannot play audio messages at all (yet),
  1052.           nor display video.  Image parts can be passed off to a  pro-
  1053.           gram  such  as  xloadimage to be viewed. Pine checks for the
  1054.           DISPLAY variable indicating it is running on an  X-terminal.
  1055.           Pine  will also display message and multipart types.  If the
  1056.           parts of a multipart message are alternate versions  of  the
  1057.           same thing Pine will select and display the one best suited.
  1058.           For parts  of  type  message/external-body,  the  parameters
  1059.           showing  the retrieval method will be displayed. Messages of
  1060.           type message/partial  cannot  currently  be  reassembled  or
  1061.           sent.  Lastly, Pine cannot display the application type, but
  1062.           works well saving parts of type application/octet stream  to
  1063.           files. (These are listed as type "file").  Any message part,
  1064.           regardless of type, can be saved to a file.
  1065.  
  1066.  
  1067.                The main focus of the MIME in Pine has been to  provide
  1068.           attachments   thus,  Pine  mainly  generates  messages  with
  1069.           application/octet-stream parts along with the text parts. As
  1070.           a bit of a bonus, Pine will recognize GIF files and tag them
  1071.           as images so they can be displayed on  X-terminals  as  men-
  1072.           tioned  above.  When  a file is attached to Pine the file is
  1073.           read and evaluated as to whether it is  ASCII  text,  8  bit
  1074.           text or binary.  If a file any lines longer than 500 charac-
  1075.           ters in it or more than 10% of the characters 8 bit it  will
  1076.           be considered binary. If the files has some 8 bit characters
  1077.  
  1078.  
  1079.                                      - 18 -
  1080.  
  1081.                             - Pine Technical Notes -
  1082.  
  1083.  
  1084.           in it will be considered 8 bit text, otherwise  it  will  be
  1085.           considered  plain text. The first part of any multipart mes-
  1086.           sage generated in Pine will always be text  with  the  other
  1087.           parts following.
  1088.  
  1089.  
  1090.                MIME has two ways of encoding 8 bit, or  non-text  data
  1091.           known  as  quoted  printable  and  base64.  Quoted printable
  1092.           leaves most of the text alone and only  changes  the  8  bit
  1093.           characters  to  "="  followed by the hex digits. For example
  1094.           "=09" is a tab. It has the advantage that it is mostly read-
  1095.           able  and that it allows for end of line conversions between
  1096.           unlike systems. Base64 encoding is similar  to  uuencode  or
  1097.           btoa  and just encodes a raw bit stream. These encodings are
  1098.           designed to get text and binary files through even the  most
  1099.           improperly implemented and configured gateways intact.
  1100.  
  1101.  
  1102.                Multipart messages can be  forwarded  and  included  in
  1103.           replies. How to do this with multimedia mail on a plain text
  1104.           device was not completely clear, so  some  improvements  are
  1105.           possible.  In  both  cases the parts of the original message
  1106.           will be included after some text. If the first part  of  the
  1107.           message was text you will be able to edit this text.  If the
  1108.           first part of the original was not text  a  new  blank  text
  1109.           part  will be added. At present Pine has trouble with multi-
  1110.           ply nested multipart messages and is unable  to  forward  or
  1111.           reply  to  them.  A  nested multipart message with a part of
  1112.           type message in between will be handled correctly.  Messages
  1113.           can  be  forwarded as MIME attachments rather than just text
  1114.           when running in old-growth mode. When this is done the  ori-
  1115.           ginal  message is included with all it headers and cannot be
  1116.           edited.  The receiver will only see the filtered  header  as
  1117.           Pine filters the headers of sub-messages.
  1118.  
  1119.  
  1120.                When a user of a non-MIME mailer receives  a  multipart
  1121.           MIME messages it will look something like this:
  1122.  
  1123.               Date: Tue, 14 Jul 1992 17:55:17 -0700 (PDT)
  1124.               From: Laurence Lundblade <lgl@cac.washington.edu>
  1125.               Subject: Test MIME message
  1126.               To: Laurence Lundblade <lgl@cac.washington.edu>
  1127.  
  1128.               --16820115-1435684063-711161753:#2306
  1129.               Content-Type: TEXT/PLAIN; charset=US-ASCII
  1130.  
  1131.               The text of the message would go here. It is readable if
  1132.               one doesn't mind wading around a little bit of the MIME
  1133.               formatting. After this is a binary file in base 64
  1134.               encoding. It has been shortened for this example. The
  1135.               Base 64 stuff looks dorky in PostScript because
  1136.               troff -me doesn't have a fixed font like courier.
  1137.  
  1138.  
  1139.                                      - 19 -
  1140.  
  1141.                             - Pine Technical Notes -
  1142.  
  1143.  
  1144.               Laurence Lundblade                       206-543-5617
  1145.                 lgl@cac.washington.edu
  1146.                    Computing and Communications, University of Washington
  1147.  
  1148.               --16820115-1435684063-711161753:#2306
  1149.               Content-Type: APPLICATION/octet-stream; name=login
  1150.               Content-Transfer-Encoding: BASE64
  1151.               Content-Description: NeXT login program
  1152.  
  1153.               AYAAAABAAAAAQAAAAQAAAL4AAAAAQAAAAEAAAJYAAAAAAAAAAAA
  1154.               AAAAAAAABfsAAADFAAAFswAAAAHAAAABwAAAAgAAAAAX190ZXh0
  1155.               AAAAF9fVEVYVAAAAAAAAAAAAAAAAAAAAAAQpAAAAxQAAAABAAAA
  1156.               AAAAAAAAAAAAABfX2Z2bWxpYl9pbml0MAAAX19URVhUAAAAAAAA
  1157.               KQAAAEwAAATuAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAF9fZnZt
  1158.               XQxAABfX1RFWFQAAAAAAAAAAAAAAAAR1AAAAAAAABToAAAAAgAA
  1159.               AAAAAAAAAAAAAAAX19jc3RyaW5nAAAAAAAAAF9fVEVYVAAAAAAA
  1160.               BHUAAADQQAAFOgAAAAAAAAAAAAAAAAAAAACAAAAAAAAAABfX2Nv
  1161.               AAAAAAAX19URVhUAAAAAAAAAAAAAAAAFRgAAACsAAAYLAAAAAIA
  1162.               AAAAAAAAAAAAAAAAF9fZGF0YQAAAAAAAAAAAABfX0RBVEEAAAAA
  1163.               AAVxAAAAQgAABjYAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAX19i
  1164.               AAAAAAAAF9fREFUQQAAAAAAAAAAAAAAABbMAAAADAAAAAAAAAAC
  1165.               AAAAAABAAAAAAAAAABfX2NvbW1vbgAAAAAAAAAAX19EQVRBAAAA
  1166.               CAlcwAlZCBMT0dJTiBGQUlMVVJFJXMgT04gJXMsICVzAHN1AGxv
  1167.               Wxsb2Mgb3V0IG9mIG1lbW9yeQoAJXMgdG9vIGxvbmcNCgAvZXRj
  1168.               3Vzci9hZG0vd3RtcAAAAABAKCMpUFJPR1JBTTpsb2dpbiAgUFJP
  1169.               WRzLTQyICBERVZFTE9QRVI6cm9vdCAgQlVJTFQ6U3VuIE5vdiAx
  1170.               zoyMSBQU1QgMTk5MAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  1171.               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  1172.               AAAAAAAAAAAAAAAAAAAAAAAAAAAQCgjKSBDb3B5cmlnaHQgKGMp
  1173.               DE5ODcsIDE5ODggVGhlIFJlZ2VudHMgb2YgdGhlIFVuaXZlcnNp
  1174.               2FsaWZvcm5pYS4KIEFsbCByaWdodHMgcmVzZXJ2ZWQuCgBAKCMp
  1175.               wk1LjQwIChCZXJrZWxleSkgNS85Lzg5AAAAABHUAAAR1f//////
  1176.               wAAEdQAABHUAAAR1AAAEdQAAAEsAxwREwT/GhkSDxcWAAAR2gAA
  1177.               AAR5gAAEeoAABHuAAAR8gAAEfYAABH6AAAR/gAAEgIAABIGAAAA
  1178.               AAB
  1179.  
  1180.               --16820115-1435684063-711161753:#2306--
  1181.  
  1182.  
  1183.  
  1184.           International Character Sets
  1185.  
  1186.  
  1187.                Pine will pass ISO-2022 escapes  sequences,  though  it
  1188.           will  not read the escape character on input (yet). There is
  1189.           a compiled in list of about 20  of  these  escape  sequences
  1190.           that  are  passed. Other sequences with the Escape character
  1191.           will not be passed. The width of these escape  sequences  is
  1192.           taken  into  account when displaying the text on the screen.
  1193.           ISO-2022 escape sequences are passed regardless of the  type
  1194.           of text as tagged by the MIME formatting
  1195.  
  1196.  
  1197.  
  1198.  
  1199.                                      - 20 -
  1200.  
  1201.                             - Pine Technical Notes -
  1202.  
  1203.  
  1204.                Pine can display  most  character  sets  in  ISO-8859-1
  1205.           through ISO-8859-9 as well as US-ASCII, the default. Rather,
  1206.           Pine doesn't actually display the characters but passes them
  1207.           through;  it  is up to the actual display device to show the
  1208.           characters correctly. For example you will need some special
  1209.           terminal  that  can  display Arabic to show ISO-8859-6 text.
  1210.           The character sets are:
  1211.  
  1212.               US-ASCII        Standard 7 bit English characters
  1213.               ISO-88590-1     8 bit European "latin 1" character set
  1214.               ISO-88590-2     8 bit European "latin 2" character set
  1215.               ISO-88590-3     8 bit European "latin 3" character set
  1216.               ISO-88590-4     8 bit European "latin 4" character set
  1217.               ISO-88590-5     8 bit Cyrillic
  1218.               ISO-88590-6     8 bit Arabic
  1219.               ISO-88590-7     8 bit Greek
  1220.               ISO-88590-8     8 bit European "latin 5"" character set
  1221.               ISO-88590-9     8 bit Hebrew
  1222.  
  1223.  
  1224.           In all of these, the lower 7 bits are the same as US-ASCII.
  1225.  
  1226.  
  1227.                 Pine makes use of the character  set  tags  associated
  1228.           with  text  in MIME to decide if text is displayable or not.
  1229.           To make use of these character sets in Pine  the  character-
  1230.           set variable should be set to match the display or terminal.
  1231.           Most fonts on X-terminals today are ISO-8859-1. When  e-mail
  1232.           arrives,  the  character set of the mail is checked and com-
  1233.           pared to the setting of the character-set  variable.  If  it
  1234.           matches, the text is displayed. If it is determined that not
  1235.           all the character can be displayed, the  ones  that  can  be
  1236.           will  be,  and  the ones that can't will be replaced by "_".
  1237.           For example if a French message arrives in ISO-8859-1  on  a
  1238.           display  that shows US-ASCII, the US-ASCII character will be
  1239.           displayed. One may set show-all-characters in the .pinerc to
  1240.           "yes" and all text will be displayed regardless of character
  1241.           set.
  1242.  
  1243.  
  1244.                When mail is sent, Pine tags the outgoing text with the
  1245.           appropriate  character  set. The character set it determined
  1246.           by the character-set variable. If the character set  is  one
  1247.           of  the ISO-8859 character sets and there are no 8 bit char-
  1248.           acters entered the tag assigned will be US-ASCII.
  1249.  
  1250.  
  1251.  
  1252.  
  1253.                        Section II -- Functions/Reference
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.                                      - 21 -
  1260.  
  1261.                             - Pine Technical Notes -
  1262.  
  1263.  
  1264.           Command Line Arguments
  1265.  
  1266.           There are a few command line arguments.  The  order  is  not
  1267.           important:
  1268.  
  1269.  
  1270.           -i           Go directly to the Mail  Index,  bypassing  the
  1271.                        main menu.
  1272.  
  1273.           -sort <type> Specify the default sort  order  for  the  main
  1274.                        index.  The  type  may  be  one  of: "subject",
  1275.                        "from", "size", "arrival", or "date". "Reverse"
  1276.                        may be added along with any of these types.
  1277.  
  1278.           -z           Enable ^Z Berkeley style job  control.  The  is
  1279.                        normally  off  because  it's not something that
  1280.                        naive users may understand
  1281.  
  1282.           -d <n>       Turn on debugging at level <n> where level  <n>
  1283.                        is  between  1 and 9.  The output is written to
  1284.                        the .pine-debugX files. Levels 8 and 9 turn  of
  1285.                        cushioning  of  aborts like bus errors and seg-
  1286.                        mentation fault
  1287.  
  1288.           -k           Turn on function key mode.
  1289.  
  1290.           -r           Go  into  restricted  demo  mode.  Saving   and
  1291.                        exporting  messages is not allowed and mail can
  1292.                        only be addresses to oneself.
  1293.  
  1294.           -conf        Print out a sample/fresh system wide configura-
  1295.                        tion file on the standard output. This is *not*
  1296.                        the same as per user  .pinerc.  They  have  the
  1297.                        same syntax and some of the same variables, but
  1298.                        they do have differences.
  1299.  
  1300.           -f <folder>  Opens the named folder as Pine starts  up.  The
  1301.                        folder  name  is  a  path relative to the users
  1302.                        "mail" subdirectory.
  1303.  
  1304.           -h           Provides a list, like this  one,  of  arguments
  1305.                        that can be given to Pine.
  1306.  
  1307.           -nr          Goes into "anonymous news readonly" mode.  This
  1308.                        is  mostly  for a particular use at the Univer-
  1309.                        sity of Washington. Pine behaves  appropriately
  1310.                        for  an  unidentified  user  to  read news, for
  1311.                        example at a public information  terminal.  The
  1312.                        set  of  commands  is  greatly  limited  and no
  1313.                        updates to the news  file  status  is  allowed.
  1314.                        This  is  usually used with both the -f and the
  1315.                        i- flags.
  1316.  
  1317.  
  1318.  
  1319.                                      - 22 -
  1320.  
  1321.                             - Pine Technical Notes -
  1322.  
  1323.  
  1324.  
  1325.  
  1326.           Address Book
  1327.  
  1328.  
  1329.                The address book is stored in the user's home directory
  1330.           in the file ".addressbook". The lines are of the format:
  1331.  
  1332.                         <nickname>TAB<fullname>TAB<address>
  1333.  
  1334.           If the entry is an address list then  <address>  is  of  the
  1335.           format:
  1336.  
  1337.                         (<address>,<address>,<address>,......)
  1338.  
  1339.             Normally entries are one per line unless it is a list  and
  1340.           then  the  entry  extends  until the closing parenthesis. If
  1341.           lines are encountered in the address book that don't fit the
  1342.           format, those that don't have two tabs, they are ignored. An
  1343.           older format is also supported where the address lists don't
  1344.           have parenthesis. Spaces are not allowed in nick names.
  1345.  
  1346.  
  1347.                Entries in the address book may refer to other  entries
  1348.           in  the  address  book.  Lists  may be infinitely nested. If
  1349.           addresses refer to each other in a loop this is detected and
  1350.           flagged.  The  address will be changed to "**** address loop
  1351.           ****".
  1352.  
  1353.  
  1354.                This file is rewritten by Pine frequently in the format
  1355.           it  thinks proper so comments or other formatting introduced
  1356.           with a text editor or other  will  not  be  maintained.  For
  1357.           example,  if  you copy some bizarre file to .addressbook and
  1358.           run Pine you're likely to find the file mostly empty as Pine
  1359.           will only write back what it understands from the file.
  1360.  
  1361.  
  1362.                There is a shell script, brk2pine.sh, that can  convert
  1363.           Berkeley  style  personal  aliases  in .mailrc files to Pine
  1364.           address book format.  It reads the users .mailrc by  default
  1365.           or  takes  a  filename  as an argument and produces the Pine
  1366.           address book on the standard output. A good way for  a  user
  1367.           to run this is:
  1368.  
  1369.                         brk2pine.sh >> .addressbook
  1370.  
  1371.           This will append the entries in the .mailrc to the  address-
  1372.           book.   System  administrators  can  convert  someone else's
  1373.           aliases with:
  1374.  
  1375.                         brk2pine.sh  ~joe/.mailrc >> ~joe/.addressbook
  1376.  
  1377.  
  1378.  
  1379.                                      - 23 -
  1380.  
  1381.                             - Pine Technical Notes -
  1382.  
  1383.  
  1384.           You can look at the  shell  script  itself  for  the  grungy
  1385.           details
  1386.  
  1387.                The address book is kept sorted in order  by  the  full
  1388.           name  field. In order for this to be sensible the full names
  1389.           should be last name, then first name. Pine makes an  attempt
  1390.           to  encourage  use of this format and will reverse the order
  1391.           of any names that have a single comma in them when they  are
  1392.           in  addresses on outgoing mail so it will be formatted first
  1393.           then last. The T, Take, command that captures addresses  off
  1394.           incoming messages also attempts to reverse the name as it is
  1395.           inserted, though it doesn't always succeed. The way it works
  1396.           can probably be improved.
  1397.  
  1398.  
  1399.                When the address book is written out, it is first writ-
  1400.           ten  to  a temporary file and if that write is successful it
  1401.           is renamed to .addressbook to guard against  errors  writing
  1402.           the  file  that  might  destroy  the whole address book. The
  1403.           address book is written after each change.
  1404.  
  1405.  
  1406.                The Pine address book is intended to be personal rather
  1407.           than shared or global.  It's not a good way to run a mailing
  1408.           list. We decided not to use or invent a scheme for a  shared
  1409.           address  book  because it would only be usable by Pine users
  1410.           and we wanted to encourage interoperability. Pine use by one
  1411.           community  should  not  preclude  use  of  other tools. Some
  1412.           thought has gone into a "work group" which would allow shar-
  1413.           ing  of address books. A work group would have a leader that
  1414.           could set up the addresses and some members that  would  use
  1415.           it.  There  aren't  any plans to implement these "groupware"
  1416.           concepts though.
  1417.  
  1418.  
  1419.           Sent Mail Pruning
  1420.  
  1421.                Because the default behavior of Pine is to save a  copy
  1422.           of  each  outgoing message we thought it useful to encourage
  1423.           the users to periodically prune their sent-mail folder.  The
  1424.           first  time  a user invokes Pine each month it will offer to
  1425.           rename sent-mail to sent-mail-mmm-yyyy  and  then  offer  to
  1426.           delete all the old sent-mail-mmm-yyyy folders with an expla-
  1427.           nation of why it is offering to do so.  The user  will  only
  1428.           be  asked once a month and the month the user was last asked
  1429.           is recorded in  the  .pinerc  file.  If  the  user  has  set
  1430.           default_fcc  in  his  .pinerc to "" then no renaming will be
  1431.           offered.
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.                                      - 24 -
  1440.  
  1441.                             - Pine Technical Notes -
  1442.  
  1443.  
  1444.           Signatures and Reply/Forward formats
  1445.  
  1446.  
  1447.                The formatting of replies  and  forwarded  messages  is
  1448.           perhaps  a  matter of current style and personal taste. Pine
  1449.           encourages the user  to  put  his  contribution  before  the
  1450.           inclusion  of  the  original  text of the message being for-
  1451.           warded or replied to, though it does provide  an  option  to
  1452.           have  it put at the bottom. This is contrary to some conven-
  1453.           tions, but makes the  message  more  readable.   The  reader
  1454.           doesn't have to scroll through the original text that he has
  1455.           probably already been seen to find  the  new  text.  If  the
  1456.           reader  wishes  to  see  the  old message(s), the reader can
  1457.           scroll further into the message.
  1458.  
  1459.  
  1460.                When replying the user also has the option of including
  1461.           the  original  message.   The original message included in a
  1462.           reply is always preceded by a line like:
  1463.  
  1464.               On Tue, 14 Jan 1992, Ken Lowe wrote:
  1465.  
  1466.  
  1467.  
  1468.                The  header  of  the  original  message  is  optionally
  1469.           included  if  the  user  sets  "header-in-reply=yes"  in his
  1470.           .pinerc. Normally it is not included.
  1471.  
  1472.  
  1473.                If the file .signature exists it will  be  included  in
  1474.           outgoing messages.  It is included before composition starts
  1475.           so the user has a chance to edit it out  if  he  likes.  The
  1476.           signature is included at the beginning of the forwarded mes-
  1477.           sage or reply in order to keep it with the new text that  is
  1478.           being  added. If the filename .signature conflicts with sig-
  1479.           natures used with other mail or news programs, the file name
  1480.           read  for  the  signature  can  be  changed  by  setting the
  1481.           "signature-file" variable in the .pinerc.
  1482.  
  1483.  
  1484.                If "old-style-reply=yes" is  included  in  the  .pinerc
  1485.           then  the  signature will be appended to the end of the mes-
  1486.           sage after any included text.  This is the more conventional
  1487.           way of including signatures.
  1488.  
  1489.  
  1490.           Spelling checker
  1491.  
  1492.  
  1493.                Pine and Pico use the standard UNIX  spelling  checker.
  1494.           Lines  beginning with ">" (messages included in replies) are
  1495.           not checked. You may substitute a different spelling checker
  1496.           or use the usual, spell with arguments, by setting the SPELL
  1497.  
  1498.  
  1499.                                      - 25 -
  1500.  
  1501.                             - Pine Technical Notes -
  1502.  
  1503.  
  1504.           environment variable to the command to be executed. The mes-
  1505.           sage  text  to  be  checked is on the standard input and the
  1506.           incorrect words are expected on the standard output.
  1507.  
  1508.  
  1509.                Words  can  be  added  to  it's  dictionary.  Here's  a
  1510.           description  of  how it can be done on some versions of UNIX
  1511.           contributed by Bob Hurt.
  1512.  
  1513.  
  1514.                In case anyone besides me uses the Spell-checking func-
  1515.           tion  in Pine (Control-T) and has words highlighted that are
  1516.           "correct" (spelling is relative, IMO), here's how to include
  1517.           a list of non-standard issue words:
  1518.  
  1519.  
  1520.  
  1521.           Step 1:
  1522.                Make a file with all the words you want to  include  in
  1523.                your new dictionary.  I did mine with one word per line
  1524.                in alphabetical order.  Caps don't matter  at  all,  as
  1525.                far as I know.
  1526.  
  1527.  
  1528.           Step 2:
  1529.                At the UNIX prompt, type: "cat [word  file]  |  spellin
  1530.                /usr/dict/hlista  >  [new dict name]" where [word file]
  1531.                is the file you just created and [new dict name] is the
  1532.                name  of  the  new  dictionary  that  Pine will look at
  1533.                instead of the standard /usr/dict/hlista.  I  named  my
  1534.                word  file  .bobwords  and my dictionary .bobspell so I
  1535.                don't have to see them when I do  a  "ls"  command  (ls
  1536.                doesn't  list  "dot" files).  I also put the above com-
  1537.                mand into my .alias file as the command "makedict" so I
  1538.                can  add  a word to my word file and easily recreate my
  1539.                dictionary.  NOTE: the new dictionary is  in  something
  1540.                called a "hashed" format, and can't be read normally.
  1541.  
  1542.  
  1543.           Step 3:
  1544.                Check your new dictionary.  At the UNIX  prompt,  type:
  1545.                "cat [word file] | spellout [new dict name]" If you did
  1546.                everything correctly, it should just give  you  another
  1547.                prompt.   If  it  lists  any of the words in your file,
  1548.                something is wrong.  I can try and  help  if  all  else
  1549.                fails.
  1550.  
  1551.  
  1552.           Step 4:
  1553.                Now you have  to  tell  UNIX  to  use  your  dictionary
  1554.                instead  of the standard one by setting the environment
  1555.                variable SPELL to access your dictionary.  Go into your
  1556.                .login  or  .cshrc  file  in  your  root  directory (it
  1557.  
  1558.  
  1559.                                      - 26 -
  1560.  
  1561.                             - Pine Technical Notes -
  1562.  
  1563.  
  1564.                doesn't seem to make a difference which  one  you  use)
  1565.                and  add  the  line:  "setenv SPELL "spell -d [new dict
  1566.                name]"". I also created an alias for SPELL in my .alias
  1567.                file so I can use the UNIX spell command to spell-check
  1568.                a file outside of Pine.  (The  .alias  line  is:  alias
  1569.                spell 'spell -d [new dict name]')
  1570.  
  1571.  
  1572.           Step 5:
  1573.                Now you need to logoff and log back on to let UNIX look
  1574.                at  your  .login  (or .cshrc) file.  I think you can do
  1575.                this by typing: "source  .login"  at  the  UNIX  prompt
  1576.                instead  of logging out, but if Step 3 worked above and
  1577.                Pine fails, try logging out.  I'm  fuzzy  on  what  the
  1578.                command "source .login" does.
  1579.  
  1580.  
  1581.                That should do it.  Go into Pine and try it out.   Good
  1582.           luck.  Bob Hurt
  1583.  
  1584.  
  1585.           Postponing mail
  1586.  
  1587.  
  1588.                Composition of a half-done message may be postponed  to
  1589.           a  later  time.   Giving the ^O command in the composer does
  1590.           this. While a message is postponed, other  messages  can  be
  1591.           composed. When the user goes into compose while a message is
  1592.           postponed he will be asked if he wants to continue the post-
  1593.           poned  message. Only one message may be postponed at a time.
  1594.           We would like Pine to be able to have more  than  one  post-
  1595.           poned  messages, but haven't got around to it mostly because
  1596.           some work would have to be done to make the  user  interface
  1597.           nice. This is a good way to quickly reference other messages
  1598.           while composing.
  1599.  
  1600.  
  1601.                In Pine 3.0 there are some problems postponing messages
  1602.           that  have  MIME  components. Messages that have attachments
  1603.           that are local files can be postponed without any  problems.
  1604.           The  postponed  message  will  only store a reference to the
  1605.           file and not the actual file, so  the  file  should  not  be
  1606.           deleted  or  renamed  until  the  message is sent. Any other
  1607.           attachments will be dropped. These would have resulted  from
  1608.           forwarding  or  replying  to  a message with multiple parts.
  1609.           Eventually this will be fixed.
  1610.  
  1611.  
  1612.                Postponing messages that use 8 bit characters sets (and
  1613.           therefore quoted-printable encoding) does not work correctly
  1614.           either. The message will not be decoded upon  resumption  of
  1615.           the  composition leaving things like "=D6" in the file where
  1616.           the 8 bit characters where. Eventually this will be fixed.
  1617.  
  1618.  
  1619.                                      - 27 -
  1620.  
  1621.                             - Pine Technical Notes -
  1622.  
  1623.  
  1624.           Interrupted Mail
  1625.  
  1626.  
  1627.                If the user is composing mail  and  is  interrupted  by
  1628.           being  disconnected  (SIGHUP  or end of file on the standard
  1629.           input), Pine will save the interrupted composition and allow
  1630.           the user to continue it when he resumes Pine. A message will
  1631.           be given that an interrupted message can be continued as the
  1632.           user  starts  Pine.  The user should go into compose to con-
  1633.           tinue and will be asked if the interrupted message should be
  1634.           resumed.  To get rid of an interrupted message continue com-
  1635.           posing, going all the way into the composer, and then cancel
  1636.           the message with ^C.
  1637.  
  1638.  
  1639.           Printers and printing
  1640.  
  1641.  
  1642.                Pine can print to the standard UNIX line printers or to
  1643.           printers   attached  to  ANSI  terminals  using  the  escape
  1644.           sequences to turn the printer on and off.  The  user  has  a
  1645.           choice of three printers in the configuration.
  1646.  
  1647.  
  1648.                The first  setting,  "attached-to-ansi"  makes  use  of
  1649.           escape sequences on ANSI/VT100 terminals. It uses "<ESC>[5i"
  1650.           to begin directing all output sent to the  terminal  to  the
  1651.           printer  and  then "<ESC>[6i" to return to normal. Pine will
  1652.           send these escape sequences in "attached-to-ansi" mode. This
  1653.           also  works  with most ANSI/VT100 emulators on Macs and PC's
  1654.           such as kermit, NCSA telnet, VersaTerm Pro  and  WinQVT.  It
  1655.           has  come to be a popular feature, though sometimes generat-
  1656.           ing a lot of questions because the various emulators  imple-
  1657.           ment  the print feature differently. For example NCSA telnet
  1658.           requires "capfile = PRN" in the config.tel file. It  doesn't
  1659.           work  at  all  on  some others like the telnet provided with
  1660.           PC-NFS.
  1661.  
  1662.  
  1663.                The second selection is the standard  UNIX  print  com-
  1664.           mand.  The default here is "lpr", but it can be changed on a
  1665.           system    basis    to     anything     so     desired     in
  1666.           /usr/local/lib/pine.conf.
  1667.  
  1668.  
  1669.                The third selection is the users personal choice for  a
  1670.           UNIX print command. The text to be printed is piped into the
  1671.           command. Enscript or lpr with options are  popular  choices.
  1672.           The  actual  command  is  retained  even if one of the other
  1673.           print selections is used for a while.
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.                                      - 28 -
  1680.  
  1681.                             - Pine Technical Notes -
  1682.  
  1683.  
  1684.                A small C program, ansiprt.c, is included in  the  con-
  1685.           trib  directory. This is can be used to get Pine to print on
  1686.           PostScript printers in conjunction with enscript. Once  com-
  1687.           piled  and installed, ansiprt can be used in a print command
  1688.           like this:
  1689.  
  1690.               enscript -p - | ansiprt
  1691.  
  1692.           What ansiprt does, is read the standard input and  write  to
  1693.           /dev/tty.  This  is  needed  because Pine reads the standard
  1694.           output and error of the print command to present to the user
  1695.           as  the result of the print job. Ansiprt also sends the ANSI
  1696.           escape sequences to turn the printer on and off.
  1697.  
  1698.  
  1699.           Function Keys and Keymaps
  1700.  
  1701.  
  1702.                The standard Pine uses alphabetic keys  for  most  com-
  1703.           mands by default, and control keys in the composer.  Despite
  1704.           possible appearances the current bindings are the result  of
  1705.           much  discussion  and  thought.  (It's  very  unlikely we'll
  1706.           change them). Currently all the commands in the composer are
  1707.           single  control  characters. This keeps things very neat and
  1708.           simple for users. There are a few control  characters  left,
  1709.           and these are being reserved for commands to attach files to
  1710.           outgoing messages. Two character commands  in  the  composer
  1711.           are a possibility, but we're trying to avoid them because of
  1712.           the added complexity for the user.
  1713.  
  1714.  
  1715.                Control-S,  Control-Q,  Control-H  and  Control-\   are
  1716.           specifically  not  used  for commands. This is an attempt to
  1717.           avoid configuration and preempt some problems.  Control-H is
  1718.           treated  the  same  as  the  delete key so, the backspace or
  1719.           delete key always works  regardless  of  any  configuration.
  1720.           This  also  keeps  Pine  out  of  trouble  if  Control-S and
  1721.           Control-Q are used for flow control.
  1722.  
  1723.  
  1724.                Pine can also operate in a twelve function key mode. To
  1725.           go  into this mode invoke "pine -k" or "pinef". You can link
  1726.           or copy the "pine" executable to "pinef" to install "pinef".
  1727.           The  command menus at the bottom of the screen will show F1-
  1728.           F12  instead  of  the  alphabetic  commands.    The   escape
  1729.           sequences  for the function keys correspond to those used on
  1730.           PC's running a locally modified version of NCSA  telnet  and
  1731.           are similar to vt100 keypad keys.  They are:
  1732.  
  1733.  
  1734.                       ANSI/VT100      VT52
  1735.               F1:     <ESC>OP <ESC>=a
  1736.               F2:     <ESC>OQ <ESC>=b
  1737.  
  1738.  
  1739.                                      - 29 -
  1740.  
  1741.                             - Pine Technical Notes -
  1742.  
  1743.  
  1744.               F3:     <ESC>OR <ESC>=c
  1745.               F4:     <ESC>OS <ESC>=d
  1746.               F5:     <ESC>Op <ESC>=e
  1747.               F6:     <ESC>Oq <ESC>=f
  1748.               F7:     <ESC>Or <ESC>=g
  1749.               F8:     <ESC>Os <ESC>=h
  1750.               F9:     <ESC>Ot <ESC>=i
  1751.               F10:    <ESC>Ou <ESC>=j
  1752.               F11:    <ESC>Ov <ESC>=k
  1753.               F12:    <ESC>Ow <ESC>=l
  1754.  
  1755.  
  1756.  
  1757.                Pine has the escape sequences for a number  of  conven-
  1758.           tions  for arrow keys hard coded and does not use termcap to
  1759.           discover  them.  This  is  because  termcap   is   sometimes
  1760.           incorrect, and because many users have PC's running terminal
  1761.           emulators that don't conform exactly to what they  claim  to
  1762.           emulate.  Pine  also  traps escape sequences for a number of
  1763.           common function keys so user don't get an error  message  or
  1764.           have  an  unexpected  command executed for each character in
  1765.           the function keys escape sequence. Some arrow  keys  on  old
  1766.           terminals  send  single  control  characters like control-k.
  1767.           These arrow keys will not work with  Pine  (One  even  sends
  1768.           control-). The most common set is:
  1769.  
  1770.  
  1771.               Up:     <ESC>[A <ESC>?x <ESC>A  <ESC>OA
  1772.               Down:   <ESC>[B <ESC>?r <ESC>B  <ESC>OB
  1773.               Right:  <ESC>[C <ESC>?v <ESC>C  <ESC>OC
  1774.               Left:   <ESC>[D <ESC>?t <ESC>D  <ESC>OD
  1775.  
  1776.  
  1777.  
  1778.                 It is possible to configure an NCD X-terminal so  some
  1779.           of   the  function  keys  operate.  The  following  are  the
  1780.           details...  Well, with Brad Greer's help, I have  been  suc-
  1781.           cessful  at  mapping  selected  keys  in  pine running in an
  1782.           xterm.  I thought you might be interested in how  it  worked
  1783.           for me.
  1784.  
  1785.  
  1786.           1    Start  up  pine  from  an  xterm,  also  specifying   a
  1787.                "resource name." This resource name will allow the user
  1788.                to specify resources for pine (that  deviate  from  the
  1789.                defaults).   -e.g.,  xterm  -name  Pine  -e pine & (the
  1790.                resource name "Pine" has a corresponding resource  sec-
  1791.                tion in the .Xdefaults file)
  1792.  
  1793.  
  1794.           2.   In my .Xdefaults file, I have the  following  "transla-
  1795.                tions", using lower hex values:
  1796.  
  1797.  
  1798.  
  1799.                                      - 30 -
  1800.  
  1801.                             - Pine Technical Notes -
  1802.  
  1803.  
  1804.                    Pine*VT100.Translations: #override 0
  1805.                    <Key>Delete:    string(0x04)
  1806.                    <Key>End:       string(0x05)
  1807.                    <Key>Escape:    string(0x03)
  1808.                    <Key>Home:      string(0x01)
  1809.                    <Key>Next:      string(0x16)
  1810.                    <Key>Prior:     string(0x19)
  1811.                    <Key>KP_Enter:  string(0x18)
  1812.  
  1813.  
  1814.  
  1815.                These seemed to be good candidates for remapping (i.e.,
  1816.           ease-of-use  &  similarity to existing mainstream software).
  1817.           Already, they have improved the  "quality"  of  my  life  in
  1818.           pine.
  1819.  
  1820.  
  1821.                One keymap I was not successful at was  the  action  of
  1822.           deleting  from  the  cursor  to the end-of-the-line (NOT the
  1823.           entire line as ^K does).  Often I only want to  delete  just
  1824.           part  of  a line, not the whole line. Any ideas? The program
  1825.           xedit works this way.  I'd appreciate any feedback  you  can
  1826.           provide.  I hope the above information proves helpful....
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.                                      - 31 -
  1860.  
  1861.                             - Pine Technical Notes -
  1862.  
  1863.  
  1864.  
  1865.                The following is a rough keymap for most of Pine.
  1866.  
  1867.  
  1868.               KEY     MAIN    VIEW    FLDR    ADRBK   CMPSE   HDER
  1869.               A       AdrBk   Attach  Add     Add     |<-     |<-
  1870.               B                                       <-      <-
  1871.               C       Cmpse   Cmpse   Cncl    Cncl    Cncl    Cncl
  1872.               D               Delete  Delete  Delete  Delete  Delete
  1873.               E               Export          Edit    ->|     ->|
  1874.               F       Folders Forward                 ->      ->
  1875.               G               Go fldr Go fldr         Help    Help
  1876.               H                                       Bk spc  Bk spc
  1877.               I       Index   Index                   TAB     TAB
  1878.               J               Jump                    Justify
  1879.               K                                       Kill ln Kill ln
  1880.               L               Print   Print   Print   Redraw  Redraw
  1881.               M               Main    Main    Main    CR      CR
  1882.               N       News    Next                    Nxt ln  Nxt ln
  1883.               O       Other   Other   Open            Postpone
  1884.               P               Prev                    Prv ln  Prv ln
  1885.               Q       Quit    Quit                    ****    ****
  1886.               R               Reply   Rename          Rd file Rch hdr
  1887.               S               Save    Save    Crt Lst ****    ****
  1888.               T               Tk Addr         Add2lst 2 Spell 2 A bk
  1889.               U               Undelete                Un Del  Un Del
  1890.               V       View    View                    Scrll D
  1891.               W               Where   Where   Where   Where
  1892.               X               Expunge                 Send    Send
  1893.               Y                                       Scrll U
  1894.               Z               Sort                    Suspend Suspend
  1895.               [                                       ****    ****
  1896.                                                      ABORT   ABORT
  1897.               ]                                       Telnet  Telnet
  1898.  
  1899.               _
  1900.               ?               Help    Help    Help
  1901.               -               Prev pg Prev pg Prev pg
  1902.               SPACE           Next pg Next pg Next Pg Nxt wrd Nxt wrd
  1903.  
  1904.  
  1905.  
  1906.  
  1907.           New Mail Notification
  1908.  
  1909.  
  1910.                Pine checks for new mail every 30 seconds. It only  has
  1911.           to  check  the  time  stamp  on the mail file, so doing this
  1912.           doesn't place a load on the system. If you really don't want
  1913.           to wait you can force a new mail check by attempting to move
  1914.           the cursor off the end of the  message  index  three  times.
  1915.           It'll  beep  and  complain as you do this, but it will check
  1916.           for new mail on the third try.
  1917.  
  1918.  
  1919.                                      - 32 -
  1920.  
  1921.                             - Pine Technical Notes -
  1922.  
  1923.  
  1924.                When there is new mail, it will be shown in the  index,
  1925.           the  screen  will  beep and a message showing the sender and
  1926.           subject will be displayed. If there has been more  than  one
  1927.           new message since you last issued a command to Pine, it will
  1928.           show the count of new messages and the sender  of  the  last
  1929.           one.
  1930.  
  1931.  
  1932.                Other UNIX new mail notification methods work with dif-
  1933.           ferent degrees of success with Pine. Most expect the mail to
  1934.           be taken out of the /usr/spool/mail file and then file to be
  1935.           truncated.  Pine  leaves  it there so you can switch between
  1936.           different mailers unlike some  other  e-mail  programs  that
  1937.           copy all the mail to a private special-format file.
  1938.  
  1939.  
  1940.           biff:
  1941.  
  1942.  
  1943.  
  1944.           wnewmail:
  1945.  
  1946.  
  1947.           csh: If the mail variable is set in the csh  it  will  check
  1948.                for new mail periodically. It does this by checking the
  1949.                modification times on the /usr/spool/mail file. If  the
  1950.                access  time  is  less  than  the modification time and
  1951.                modification time and the access time are greater  than
  1952.                the  last  time  a  check  was made it prints "You have
  1953.                mail". The message will be "You have new mail"  if  the
  1954.                modification  time  is  greater  than the time the last
  1955.                command was executed.
  1956.  
  1957.  
  1958.                This doesn't work  perfectly  with  Pine  because  Pine
  1959.                modifies  the  mail file when it changes message status
  1960.                and expunges messages  leading  the  shell  to  believe
  1961.                there is new mail.
  1962.  
  1963.  
  1964.           login:
  1965.                The login program prints "You have mail"  if  there  is
  1966.                anything  in  /usr/spool/mail. With Pine this is always
  1967.                the case, so it will always give this message. On  most
  1968.                systems  it will say "You have new mail" if the modifi-
  1969.                cation time is later than the access time. Though  Pine
  1970.                rewrites  the  mail  file when it exists to delete mail
  1971.                messages and update status, it resets the  modification
  1972.                time to be earlier than the access time so this mechan-
  1973.                ism should work. When you have new mail login will  say
  1974.                so.
  1975.  
  1976.  
  1977.  
  1978.  
  1979.                                      - 33 -
  1980.  
  1981.                             - Pine Technical Notes -
  1982.  
  1983.  
  1984.           Mail folder checkpointing
  1985.  
  1986.  
  1987.                Periodically Pine will save the whole  mail  folder  to
  1988.           disk to prevent loss of any mail or mail status in case Pine
  1989.           gets interrupted, disconnected or  crashes.  The  period  of
  1990.           time Pine waits to do the checkpoint is carefully calculated
  1991.           to be minimally intrusive. The timing can be changed at com-
  1992.           pile  time  in  the os_xxx.h file and the delays are divided
  1993.           into levels
  1994.  
  1995.  
  1996.           Good Time:     This occurs when Pine has been idle for  more
  1997.                          than  30  seconds.  In  this  case  Pine will
  1998.                          checkpoint if 12 changes  to  the  file  have
  1999.                          been  made  or  at  least one change has been
  2000.                          made and a checkpoint hasn't been done for  5
  2001.                          minutes.
  2002.  
  2003.  
  2004.           Bad Time:      This occurs just after Pine has executed some
  2005.                          command. Pine will checkpoint if there are 36
  2006.                          outstanding changes to the mail  file  or  at
  2007.                          least  one  change  and not checkpoint for 10
  2008.                          minutes.
  2009.  
  2010.  
  2011.           Very Bad Time: Done when composing a message. In  this  case
  2012.                          Pine  will  only  checkpoint  if  at least 48
  2013.                          changes have been made or one change has been
  2014.                          made  in  the  last  20 minutes with no check
  2015.                          point.
  2016.  
  2017.  
  2018.           Disk Quotas and Usage
  2019.  
  2020.  
  2021.                All mail files are stored under  the  "mail"  subdirec-
  2022.           tory. A command in the "other" menu shows the disk usage and
  2023.           free space. The total that is shown for mail folder  is  the
  2024.           total of the files found in the mail subdirectory. The shown
  2025.           number for the free space is either the space  left  in  the
  2026.           users disk quota or the space left on the disk drive, which-
  2027.           ever is smaller. The text associated with the  message  will
  2028.           say which. If the user is over his quota, that will be shown
  2029.           and a message will be displayed  when  the  user  starts  up
  2030.           Pine. Pine knows how to access the standard UNIX quotas data
  2031.           bases, well at least two versions of it.
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.                                      - 34 -
  2040.  
  2041.                             - Pine Technical Notes -
  2042.  
  2043.  
  2044.           Alternate editor for composing
  2045.  
  2046.  
  2047.                In Pine 3.0 you can use any text editor such as  vi  or
  2048.           emacs,  for  composing  the  message text. The addresses and
  2049.           subject still must be edited using the  standard  Pine  com-
  2050.           poser.  It  operates in one of two ways. If you select "old-
  2051.           growth" mode in your .pinerc you can type "^_" while in  the
  2052.           composer  and  be  prompted  for  the editor. If you set the
  2053.           "editor" variable in your .pinerc then "^_" will  appear  in
  2054.           the  composer key menu and will invoke the configured editor
  2055.           when you type it.
  2056.  
  2057.  
  2058.                We know that many folks would like to  use  the  custom
  2059.           editor  to  edit  the  mail  header  as  well. We considered
  2060.           several designs for this and didn't come up with one that we
  2061.           liked and that was easy to implement.  One of the main prob-
  2062.           lems is that you lose access to  the  address  book.   There
  2063.           will probably be further discussion on this!...
  2064.  
  2065.  
  2066.           Pico
  2067.  
  2068.  
  2069.                The message composer in Pine is  actually  compiled  in
  2070.           and part of Pine. Pico is a stand-alone version of that edi-
  2071.           tor that can be used to edit text files  or  other.  It  has
  2072.           word wrap, justification and spelling just like the composer
  2073.           in Pine. It has the following command line options:
  2074.  
  2075.  
  2076.           -f   Turn on function keys
  2077.  
  2078.           -nN  Turn on new mail checking every N seconds
  2079.  
  2080.           -v   View file only, no editing
  2081.  
  2082.           -w   Disable word wrap
  2083.  
  2084.           -z   Turn on ^Z suspension
  2085.  
  2086.                The Pico man page has more details and lists more  com-
  2087.                mand line options.
  2088.  
  2089.  
  2090.           Mail folders and formats
  2091.  
  2092.  
  2093.                Just about all mail folders are kept in the "mail" sub-
  2094.           directory.  The  one exception is "inbox" which is more of a
  2095.           place holder for what ever is the standard place to get  new
  2096.           mail  on  the system. The default format used by Pine is the
  2097.  
  2098.  
  2099.                                      - 35 -
  2100.  
  2101.                             - Pine Technical Notes -
  2102.  
  2103.  
  2104.           Berkeley mail format. It is used by the standard "mail" com-
  2105.           mand  and  by  elm. Basically mail messages are separated by
  2106.           lines that look like:
  2107.  
  2108.           From deroest@daffy.cac.washington.edu  Fri Jan  11  14:32:33
  2109.           1991
  2110.  
  2111.  
  2112.                If a file doesn't look like this,  Pine  will  consider
  2113.           it's  format  to be invalid and refuse to open the file. The
  2114.           use of his format is also the reason you  will  occasionally
  2115.           see  ">From"  in  the  mail  message  text.  The ">" must be
  2116.           inserted so there is no confusion between the  text  of  the
  2117.           message  and  the  separator.  This  is a silly problem that
  2118.           should have been solved long ago with a more reasonable mail
  2119.           file  format. The sender and date information in the separa-
  2120.           tor are not used by Pine.  You can fool Pine into thinking a
  2121.           file  is  a mail folder by adding a message separator at the
  2122.           beginning of the file and where ever you want message  boun-
  2123.           daries.  Pine  believes the message header ends at the first
  2124.           blank line in message.
  2125.  
  2126.  
  2127.                Pine also knows how to read other file formats,  namely
  2128.           Tenex and USENET News.
  2129.  
  2130.  
  2131.                The inbox folder is treated specially. It  is  normally
  2132.           kept  open  constantly  so  the  arrival  of new mail can be
  2133.           detected. The name "inbox" refers to where ever new mail  is
  2134.           retrieved  on the system. If the inbox-path variable is set,
  2135.           "inbox" refers to that. The "sent-mail" and  "saved-message"
  2136.           folders  are also some what special.  They are automatically
  2137.           created if  they  are  absent  and  recreated  if  they  are
  2138.           deleted.
  2139.  
  2140.  
  2141.                Pine provides an "export" command to write the contents
  2142.           of  a message to a file for use outside of Pine. When a mes-
  2143.           sage is written this way Pine pays attention  to  the  umask
  2144.           for  the  setting of the file permissions. When a message is
  2145.           saved to a folder, the folder is created  so  that  read  or
  2146.           write permission is granted only to the owner of the file.
  2147.  
  2148.  
  2149.           Message Status and the expunge command
  2150.  
  2151.  
  2152.                Each message has some status flags. Pine  only  uses  a
  2153.           few  of  the  flags supported by the Berkeley format and the
  2154.           c-client. A flag is set if the message  is  new  and  hasn't
  2155.           been  read.  An  "N"  shows in the messages index. The other
  2156.           flag used is "D" to mark a message as deleted.  The  message
  2157.  
  2158.  
  2159.                                      - 36 -
  2160.  
  2161.                             - Pine Technical Notes -
  2162.  
  2163.  
  2164.           is  not actually deleted until the mail box is expunged. The
  2165.           expunge operation basically deletes all the messages  marked
  2166.           for  deletion.  The  user  may give the "X" command to do an
  2167.           expunge any time he wants to, or may wait till he is exiting
  2168.           Pine  or  closing  the  folder,  when  Pine offers to do the
  2169.           expunge.  Internally, the message  status  is  kept  in  the
  2170.           "Status:" and "X-Status:" fields in the message header.
  2171.  
  2172.  
  2173.           Sorting
  2174.  
  2175.  
  2176.                The mail index may now  be  sorted  by  subject,  size,
  2177.           sender,  date and arrival order. The "z" command will prompt
  2178.           the user for the sort order. The  sort  order  can  also  be
  2179.           specified  on  the  command line with the -sort flag. When a
  2180.           user changes folders, the sort order will  go  back  to  the
  2181.           original  sort order, usually the arrival order. The command
  2182.           line sort specification changes  the  original  sort  order.
  2183.           Each sort order can also be reversed.
  2184.  
  2185.  
  2186.                When a folder is sorted and new  mail  arrives  in  the
  2187.           folder  it  will  be inserted in it's properly sorted place.
  2188.           This can be a little odd when the folder is sorted by  some-
  2189.           thing like the subject.
  2190.  
  2191.  
  2192.                The sorts are all independent of case. and ignore lead-
  2193.           ing  or trailing white space. The subject sort ignores "Re:"
  2194.           at the beginning and will soon ignore "(fwd)"  at  the  end.
  2195.           The  sort  of sender sorts by the userid, not the full name.
  2196.           The arrival sort is basically no sort at all  and  the  date
  2197.           sort  depends  on  the format of the date. Some dates are in
  2198.           strange formats and are unparsable. The time  zone  is  also
  2199.           taken into account.
  2200.  
  2201.  
  2202.                Sorting large mail folders can be very  slow  since  it
  2203.           requires fetching all the headers of the mail messages. Usu-
  2204.           ally only the first sort is slow though since Pine  keeps  a
  2205.           copy of all the headers. One exception is sorting in reverse
  2206.           arrival order. This is fast because no headers  have  to  be
  2207.           examined. Pine will show progress as it is sorting.
  2208.  
  2209.  
  2210.           Feature level
  2211.  
  2212.  
  2213.                Pine now has a settable feature level for users of dif-
  2214.           ferent  experience.  This  is  only partially implemented in
  2215.           Pine 3.0. The planned levels are "seedling",  "sapling"  and
  2216.           "old-growth".  In  Pine  3.0  there  are  only "sapling" and
  2217.  
  2218.  
  2219.                                      - 37 -
  2220.  
  2221.                             - Pine Technical Notes -
  2222.  
  2223.  
  2224.           "old-growth" modes, and the only difference is that the  "h"
  2225.           command  to  show  full  headers  is available in old-growth
  2226.           mode. A command to pipe messages into other programs is next
  2227.           in the plan for old-growth.
  2228.  
  2229.  
  2230.           Anonymous Readonly Mode for News
  2231.  
  2232.  
  2233.                Pine has a mode appropriate for anonymous access  to  a
  2234.           folder  or  a  news group. This leaves off the sender of the
  2235.           message in the index and allows no  status  updates  to  the
  2236.           folder  or  news group. Messages cannot be deleted or saved.
  2237.           Mail cannot be composed, though mail can be forwarded.  This
  2238.           is usually used with the -i and -f options.
  2239.  
  2240.  
  2241.  
  2242.  
  2243.           Section III -- Compiling, Debugging, Porting and Source Code
  2244.  
  2245.  
  2246.           Debug files
  2247.  
  2248.  
  2249.                If Pine is compiled  with  the  DEBUG  option  on  (the
  2250.           default  in Pine 2.0), then pine will produce debugging out-
  2251.           put to a file. The file  is  normally  .pine-debugX  in  the
  2252.           users  home  directory where X goes from 1 to 4. Number 1 is
  2253.           always the most recent session and 4 the oldest. 4 are saved
  2254.           because  often  the  user  has gone in and out of Pine a few
  2255.           times after a problem has occurred before the  expert  actu-
  2256.           ally  gets  to look at it. The amount of output in the debug
  2257.           files varies with the debug level. The default is  level  2.
  2258.           This  shows  very general things and records errors. Level 9
  2259.           produces rather copious  amounts  of  output  for  each  key
  2260.           stroke.
  2261.  
  2262.  
  2263.           Memlog
  2264.  
  2265.  
  2266.                There's a few source files and hooks in the Pine source
  2267.           to  log  each memory allocation and each free. This was used
  2268.           to check and debug memory leaks. The  few  found  are  fixed
  2269.           now. The code is retained for future checking. Two makefiles
  2270.           exist for compiling with the memory logging  turned  on  for
  2271.           the  "nxt"  and "ult" platforms. This hasn't been used for a
  2272.           while so it might not quite work. A log of  the  allocations
  2273.           and  frees  is written to a file along with frequency counts
  2274.           and the net outstanding amount of leaked memory.  Pine  runs
  2275.           much less efficiently when this is enabled.
  2276.  
  2277.  
  2278.  
  2279.                                      - 38 -
  2280.  
  2281.                             - Pine Technical Notes -
  2282.  
  2283.  
  2284.           Signals, aborts and core dumps
  2285.  
  2286.  
  2287.                Pine catches SIGHUP and does the best thing with it. If
  2288.           a  message  is  under composition it will be saved as inter-
  2289.           rupted mail which can be continued by  going  into  compose.
  2290.           SIGHUP  occurs  when the session is disconnected for reasons
  2291.           such as a modem hanging up, the client workstation rebooting
  2292.           or  other.  Pine also catches SIGQUIT (^\) and asks the user
  2293.           if he really wants to quit. This was added because we  found
  2294.           many  pine core files generated by nothing other than ^\. ^\
  2295.           is retained so there is some emergency exit.
  2296.  
  2297.  
  2298.                If pine is not compiled  for  debugging  or  the  debug
  2299.           level  is  set low Pine will also catch the other abort sig-
  2300.           nals like SIGSEGV (segmentation fault) so it  can  clean  up
  2301.           the  tty  modes  and exit. It prints a message that a bug in
  2302.           Pine has been encountered and dumps  a  core  file.  If  the
  2303.           debug  level  8 or higher then these signals won't be caught
  2304.           and the core dump will just happen.
  2305.  
  2306.  
  2307.           Pine help text
  2308.  
  2309.  
  2310.                The file pine.hlp contains all the help text for  Pine.
  2311.           Normally,  it  is  compiled  right  into  the Pine binary as
  2312.           strings. This is done to simplify  installation  and  confi-
  2313.           guration.  The  pine.hlp file is in a special format that is
  2314.           documented at the beginning of the file.   Basically  it  is
  2315.           divided  into sections, each with a name that winds up being
  2316.           referenced as a global variable. There is also some  special
  2317.           formatting  to keep things lined up and to allow for substi-
  2318.           tutions in the help text depending on whether the key labels
  2319.           are  the  standard alphabetic/mnemonic or they are the func-
  2320.           tion keys. These files are processed by two awk scripts  and
  2321.           turned into C files that are in turn compiled in to Pine.
  2322.  
  2323.  
  2324.                This scheme can increase efficiency when Pine  is  com-
  2325.           piled  to have the strings as part of shared read-only text.
  2326.           This works on machines that have  separate  instruction  and
  2327.           data  space,  which  is most machines today Rather than each
  2328.           process having to read in the help text  from  a  file,  the
  2329.           strings are shared by all executing processes on the machine
  2330.           and demand paged.  At the moment the Dynix port and the NeXT
  2331.           port  do  this.   How  to go about this for other ports will
  2332.           depend on the compiler. On the NeXT it  is  automatic.  With
  2333.           Dynix it required some work. The file with the help text had
  2334.           to be compiled with the -R option. In  addition,  on  Dynix,
  2335.           xstr is used to reduce all the identical strings to a single
  2336.           occurrence. This was done  because  higher  performance  was
  2337.  
  2338.  
  2339.                                      - 39 -
  2340.  
  2341.                             - Pine Technical Notes -
  2342.  
  2343.  
  2344.           needed for the Dynix version because of very heavy use.
  2345.  
  2346.  
  2347.           Source code organization
  2348.  
  2349.            The source code is in four directories with a shell script,
  2350.           "build", that descends into each and invokes the appropriate
  2351.           makefile to compile Pine and related  programs.  The  direc-
  2352.           tories are:
  2353.  
  2354.             - c-client: This is a set of library routines that form an
  2355.           interface to the mail store and act as a switch between dif-
  2356.           ferent mail  file  formats/drivers.  Currently  it  supports
  2357.           IMAP,  Berkeley  format (elm, mail..), Tenex and netnews. It
  2358.           also does all the RFC-822 parsing (a very thorough job)  and
  2359.           is one of the pilot implementations of the upcoming Internet
  2360.           standard, "MIME" for multipart mail. Also, in  the  c-client
  2361.           directory  is  mtest,  a very simple stand alone mail client
  2362.           that uses the c-client. It's useful for testing the c-client
  2363.           or  imap  connections  independent  of  a more involved mail
  2364.           client.  The c-client included here is only a  minimal  part
  2365.           of  the imap source tree. If you plan on doing anything more
  2366.           with imap and the c-client than using or  porting  Pine  you
  2367.           should    get    the    full    imap    source   tree   from
  2368.           ftp.cac.washington.edu. Mark Crispin is the  author  of  the
  2369.           c-client and IMAP protocol.
  2370.  
  2371.             - pico: Pico stands for PIne's COmposer. The  source  here
  2372.           is for the Pico library and the Pico main program. When com-
  2373.           piled with Pine it is the Pine  message  composer,  spelling
  2374.           checker  and such. When compiled against the Pico main it is
  2375.           the stand alone Pico  editor.  Pico  is  in  part  based  on
  2376.           micro-emacs and is written by Mike Seibel
  2377.  
  2378.             - imapd: The imapd daemon.  This  is  a  small  amount  of
  2379.           source  to turn the c-client library into a daemon that runs
  2380.           on a mail server to serve imap clients. This is only  needed
  2381.           if you are using the imap protocol.
  2382.  
  2383.             - pine: The code here is the primary Pine user  interface.
  2384.           It  relies on the c-client and pico libraries and implements
  2385.           all the Pine screens except the composer. It also implements
  2386.           the  address  book, configuration files and includes the on-
  2387.           line help text.
  2388.  
  2389.             - contrib: This directory contains  contributed  additions
  2390.           to Pine
  2391.  
  2392.  
  2393.           Porting Pine to other Platforms
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399.                                      - 40 -
  2400.  
  2401.                             - Pine Technical Notes -
  2402.  
  2403.  
  2404.                Substantial effort has gone into  making  Pine/Pico  as
  2405.           portable  as  possible. There are still, of course, a number
  2406.           of machine dependencies.  We've picked  a  small  number  of
  2407.           platforms  for which we will do our best to provide a tested
  2408.           and running port.  Currently they are Ultrix,  NeXT,  SunOS,
  2409.           Dynix and AIX/370. We are also willing to redistribute ports
  2410.           to other platforms as they conform to  the  invented  scheme
  2411.           for handling different platforms.
  2412.  
  2413.  
  2414.                Each platform is given a three  letter  name  (see  the
  2415.           file  doc/pine-ports).  Make up a new one for your new port.
  2416.           We've tried to bring  all  potential  platform  dependencies
  2417.           into  three files, os-xxx.h, os-xxx.c and makefile.xxx where
  2418.           xxx is the three letter name of the port. Thus any new  port
  2419.           will  hopefully  just  result in new versions of these files
  2420.           and some notes for the pine-ports  file.  This  is  actually
  2421.           nine  new  files  because there are a set of these files for
  2422.           the c-client, pico and pine source directories.
  2423.  
  2424.  
  2425.                The make files are kept as simple and straight  forward
  2426.           as  possible because many previous attempts at automatically
  2427.           figuring out what to do seem to become complex and  ineffec-
  2428.           tive  in what they set out to do: make compiling and instal-
  2429.           ling  the  program  easy.  Each  port  is  for  a   specific
  2430.           hardware/software  platforms,  also because past attempts to
  2431.           generalize on versions of  UNIX  or  some  CPU  architecture
  2432.           don't  seem  to  have gained much. Thus, there is a separate
  2433.           makefile for each platform that calls the  appropriate  com-
  2434.           piler, archiver and linker with the appropriate flags.  Most
  2435.           of these makefiles are pretty  similar.  The  makefile  also
  2436.           specifies  which  of the os-xxx.c and os-xxx.h files to use.
  2437.           It is the root from which   all  platform  dependencies  are
  2438.           selected.  In some cases the makefile defines a symbol named
  2439.           after the platform on which there can be dependencies in the
  2440.           source  code.   Pine,  Pico  and the C-client don't quite do
  2441.           everything the same  (there  are  three  authors  involved).
  2442.           Basically  to  build  the  source in a directory for a given
  2443.           platform, run "make -f makefile.xxx" where "xxx" is the  the
  2444.           three letter name of the platform.
  2445.  
  2446.  
  2447.                 The file os-xxx.h is used for general platform  depen-
  2448.           dent  #include's  and #defines. A few things that affect all
  2449.           the source are here, such as a macro defining the type  that
  2450.           qsort() and signal() return. All the include files that have
  2451.           been found to vary from one platform  to  another  are  also
  2452.           included  here.  In the case of Pine and Pico, there is only
  2453.           one os-xxx.h file called os-unx.h for  the  officially  sup-
  2454.           ported  ports  and  inside  it  are  #ifdefs on the platform
  2455.           specific symbol defined in the makefile. For the current set
  2456.           of  ports, which have more in common than different, this is
  2457.  
  2458.  
  2459.                                      - 41 -
  2460.  
  2461.                             - Pine Technical Notes -
  2462.  
  2463.  
  2464.           simpler.  If the changes to os-xxx.h become large it will be
  2465.           better to create a new os-xxx.h file named for the new plat-
  2466.           form.  We also prefer new os-xxx.c and  os-xxx.c  files  for
  2467.           new  ports so that we don't have to merge any source.  There
  2468.           are a number of Pine configuration settings that are defined
  2469.           here  such as the place it looks for certain files, defaults
  2470.           for the printer and folder names, the  maximum  screen  size
  2471.           and so on.
  2472.  
  2473.  
  2474.                The os-xxx.c file contains functions  that  are  poten-
  2475.           tially  platform dependent. Again, the idea is to gather all
  2476.           the dependencies in one place. Pine and Pico  use  the  same
  2477.           strategy  here  as  used with os-unx.h.  Since Pine has been
  2478.           ported to both Berkeley and System V UNIX most of the  func-
  2479.           tions for any given port have been created thus doing a port
  2480.           is usually a matter of finding the appropriate functions  in
  2481.           from  the  existing  ports.  For example, there are two ways
  2482.           different systems do dates and time zones so you'll find two
  2483.           different  versions  of  rfc822_date() in c-client/os_aix.c,
  2484.           and c-client/os_ult.c.  The  other  c-client/os_xxx.c  files
  2485.           have one or the other version of these functions.
  2486.  
  2487.  
  2488.                It is strongly encouraged that no changes  be  made  to
  2489.           the general source when porting and that all changes be con-
  2490.           tained to the three/nine system dependent files. The  object
  2491.           is to maintain source code integrity and assimilate ports to
  2492.           new platforms rapidly. The more conventional way to do  this
  2493.           is with a large collection of #ifdefs. The problem with this
  2494.           is that adding a port for a new  platform  implies  changing
  2495.           the  source  code  for  all  the other platforms and thereby
  2496.           risks breaking them. This scheme in Pine has  been  designed
  2497.           to  avoid  that, at the cost of making it a little harder to
  2498.           port Pine.
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.                                      - 42 -
  2520.  
  2521.                             - Pine Technical Notes -
  2522.  
  2523.  
  2524.           Test Checklist
  2525.  
  2526.  
  2527.                The following is a check list for testing a new port:
  2528.  
  2529.           ___  Sending mail, check that full name is correct
  2530.           ___  Replying to and forwarding a message
  2531.           ___  Postponing message under composition
  2532.           ___  Make sure local user names are expanded
  2533.           ___  Test spelling checker
  2534.           ___  Catching of SIGHUP while message is composition
  2535.           ___  Setting of user-domain and use-only-domain in .pinerc
  2536.           ___  New mail notification. Should happen with Pine idle  to
  2537.                check timeouts
  2538.           ___  Reading mail in index
  2539.           ___  Deleting and undeleting
  2540.           ___  Expunge to empty folder
  2541.           ___  Make sure that "~" expansion works
  2542.           ___  Save message to folder, check error conditions such  as
  2543.                permission denied
  2544.           ___  Export message
  2545.           ___  Checkpointing (make 20 status changes, or 19  and  wait
  2546.                30 sec)
  2547.           ___  Open IMAP and RIMAP folders
  2548.           ___  Test opening bogus folders: invalid format, no  permis-
  2549.                sion
  2550.           ___  Open a USENET news group via IMAP
  2551.           ___  Pine -f option
  2552.           ___  Disk quotas and usage (over, under, and device space)
  2553.           ___  Change password
  2554.           ___  Lock keyboard
  2555.           ___  Address book operations
  2556.           ___  Take command
  2557.           ___  Send mail with empty address book
  2558.           ___  Make sure that  SIGQUIT,  ^ confirmation  works  (check
  2559.                core dump too)
  2560.           ___  Test panic (Give '#' command on main  menu  with  debug
  2561.                level > 8)
  2562.           ___  Make sure SIGSTP, ^Z works (-z option)
  2563.           ___  Pinef
  2564.           ___  Sent-mail pruning
  2565.           ___  Printing using all three printer configurations
  2566.           ___  View help text & news
  2567.           ___  Folder list operations (rename, create, delete...)
  2568.           ___  Window resizing
  2569.           ___  Error messages for incorrect terminal types (try  "foo"
  2570.                and "vt52")
  2571.           ___  Reading of /usr/local/lib/pine.conf
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.                                      - 43 -
  2580.  
  2581.                             - Pine Technical Notes -
  2582.  
  2583.  
  2584.                 Section IV -- Differences between version 2.4 and 3.0
  2585.  
  2586.  
  2587.                This may be a bit rough and tumble, but hopefully  will
  2588.           provide enough information for system administrators to know
  2589.           what they are getting into by installing Pine 3.0  (3.02  by
  2590.           now).
  2591.  
  2592.  
  2593.                The biggest change in Pine is  the  support  for  MIME.
  2594.           This has affected a lot of source code. All seems to be run-
  2595.           ning well, but some of the MIME functions themselves are not
  2596.           highly polished. See the section on MIME for more details on
  2597.           what it is all about. The one case we've seen where MIME can
  2598.           intrude into normal non-MIME operations is when users either
  2599.           accidentally or intentionally include 8  bit  characters  in
  2600.           outgoing  messages.  This  will  cause  Pine  to  apply  the
  2601.           quoted-printable encoding to turn it into 7 bit ASCII  since
  2602.           8 bit characters are not allowed in Internet mail (though it
  2603.           often works and  some  make  use  of  it).  Other  than  the
  2604.           "Attchmnt:" field showing in the compose and the "A" command
  2605.           in the Mail Viewer, most users will not notice  any  differ-
  2606.           ences because of the MIME support.
  2607.  
  2608.  
  2609.                The Pine main menu has a bit of a  new  look.  The  "V"
  2610.           command  has  been moved off the main menu as we found some-
  2611.           thing like half of the Pine users at the UW were  not  using
  2612.           the index at all. Instructors in the training classes always
  2613.           had to introduce folks to the index. Some users  would  even
  2614.           lose  mail because they couldn't figure out where their mail
  2615.           was.  By default, this version of Pine displays an  explana-
  2616.           tion  for the change in the main menu and a message that the
  2617.           previous version can be had with  "pine.old".  This  can  be
  2618.           turned     off     by     putting     "new-version=no"    in
  2619.           /usr/local/lib/pine.conf. The "News" item was moved into the
  2620.           "Other"  menu  and the "Who to Call" text is now included as
  2621.           the first page of the help text on the main menu.
  2622.  
  2623.  
  2624.                Pine and Pico now include a file browser for  selecting
  2625.           files  to  be  included "read in". The user can navigate his
  2626.           directory trees and such. This is invoked by typing ^T  when
  2627.           prompted for the file name.
  2628.  
  2629.  
  2630.                New features that shouldn't have any caveat's are:
  2631.  
  2632.           +    Index can be sorted by subject, sender,  size,  arrival
  2633.                or date
  2634.           +    Command line option to specify sort order
  2635.           +    Confirms  with  user  before  sending  message  to  the
  2636.                mailer-daemon
  2637.  
  2638.  
  2639.                                      - 44 -
  2640.  
  2641.                             - Pine Technical Notes -
  2642.  
  2643.  
  2644.           +    New command line option "-i" to go  directly  into  the
  2645.                index
  2646.           +    New command line option "-nr" for news/readonly mode
  2647.           +    Bcc saved in sent-mail and shown when viewed
  2648.           +    Fixed bug causing core dumps with very long addresses
  2649.           +    No limit on the number of messages in a folder
  2650.           +    Fix for address book screen painting problem with  Pro-
  2651.                comm and with composing on VT102s at low speeds
  2652.           +    Passes ISO-2022 character set  shift  escape  sequences
  2653.                for the display of Japanese and other languages
  2654.           +    Pays attention to  umask  when  exporting  messages  to
  2655.                files
  2656.           +    Option in .pinerc to have signature at bottom  of  mes-
  2657.                sage
  2658.           +    More efficient screen painting for low speed use
  2659.           +    Upon opening a folder the current message is now  first
  2660.                unread, ("N") message
  2661.           +    Pine.conf  and  .pinerc  variable  can  reference  UNIX
  2662.                environment variables
  2663.           +    Long line wrapping improved, now broken at spaces
  2664.           +    Checkpointing is less frequent and  at  more  opportune
  2665.                times
  2666.           +    Carries received date along properly for Berkeley  mail
  2667.                file format
  2668.           +    Disable ^Z suspension when keyboard is locked
  2669.           +    Shows READONLY or CLOSED with the folder name in  title
  2670.                bar
  2671.           +    When viewing mail,  the  header  is  displayed  in  the
  2672.                canonical "Full Name <address> format". Order of header
  2673.                is also uniform.
  2674.           +    Title bar format slightly different -- shows "Folder: "
  2675.  
  2676.  
  2677.                There is now, or will be different modes for  different
  2678.           user  levels.  Three modes are planed: "seedling", "sapling"
  2679.           and "old-growth".  Currently,  Pine  defaults  to  "sapling"
  2680.           mode. There is also "old-growth" mode that adds the "h" com-
  2681.           mand to view the full header and the  "^_"  command  in  the
  2682.           composer  to  select  an  alternate  editor. These modes are
  2683.           selected with the user-level variable in the .pinerc.
  2684.  
  2685.  
  2686.                There are a number of new  configuration  variable  for
  2687.           pine.conf and
  2688.  
  2689.  
  2690.               smtp-server
  2691.               editor
  2692.               image-viewer
  2693.               feature-level
  2694.               old-style-reply
  2695.               signature-file
  2696.               mail-directory
  2697.  
  2698.  
  2699.                                      - 45 -
  2700.  
  2701.                             - Pine Technical Notes -
  2702.  
  2703.  
  2704.               character-set
  2705.               show-all-characters
  2706.               new-version
  2707.  
  2708.  
  2709.  
  2710.                One can now use their favorite editor to  compose  mail
  2711.           in  Pine!  If  the editor variable is set in the .pinerc the
  2712.           "^_" command to start the editor will show in the  composer.
  2713.           Alternately,  when  operating  in  old-growth mode, the "^_"
  2714.           command can be given, even it it's not displayed.  You  will
  2715.           be prompted for the editor of your choice.
  2716.  
  2717.  
  2718.                There are now ports for Dynix/PTX and HP/UX. These  are
  2719.           both  System  V based and Pine is generally more portable to
  2720.           System V platforms.
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.                                      - 46 -
  2760.  
  2761.                             - Pine Technical Notes -
  2762.  
  2763.                              Version 3.0, July 1992
  2764.  
  2765.           Section I -- Installation, Design and Internals .......    1
  2766.           Building and Installation .............................    1
  2767.           Design goals ..........................................    3
  2768.           IMAP (The Interactive Mail Access Protocol) ...........    4
  2769.           Address Formats (RFC-822 Compliance) ..................    5
  2770.           Known Bugs and Problems ...............................    6
  2771.           Domain names ..........................................    6
  2772.           Pine Configuration (system wide and per user) .........    8
  2773.           Mail folder  reading,  writing,  locking  and  check
  2774.                pointing .........................................   12
  2775.           Terminals and Termcap .................................   14
  2776.           Memory Usage ..........................................   14
  2777.           Sendmail, SMTP and mail delivery ......................   15
  2778.           The Berkeley Mail file format and locking .............   15
  2779.           Accessing mail folders via NFS ........................   16
  2780.           MIME -- Multipart Internet Mail Extensions ............   17
  2781.           International Character Sets ..........................   20
  2782.           Section II --  Functions/Reference ....................   21
  2783.           Command Line Arguments ................................   22
  2784.           Address Book ..........................................   23
  2785.           Sent Mail Pruning .....................................   24
  2786.           Signatures and Reply/Forward formats ..................   25
  2787.           Spelling checker ......................................   25
  2788.           Postponing mail .......................................   27
  2789.           Interrupted Mail ......................................   28
  2790.           Printers and printing .................................   28
  2791.           Function Keys and Keymaps .............................   29
  2792.           New Mail Notification .................................   32
  2793.           Mail folder checkpointing .............................   33
  2794.           Disk Quotas and Usage .................................   34
  2795.           Alternate editor for composing ........................   34
  2796.           Pico ..................................................   35
  2797.           Mail folders and formats ..............................   35
  2798.           Message Status and the expunge command ................   36
  2799.           Sorting ...............................................   37
  2800.           Feature level .........................................   37
  2801.           Anonymous Readonly Mode for News ......................   38
  2802.           Section III --  Compiling,  Debugging,  Porting  and
  2803.                Source Code ......................................   38
  2804.           Debug files ...........................................   38
  2805.           Memlog ................................................   38
  2806.           Signals, aborts and core dumps ........................   39
  2807.           Pine help text ........................................   39
  2808.           Source code organization ..............................   40
  2809.           Porting Pine to other Platforms .......................   40
  2810.           Test Checklist ........................................   43
  2811.           Section IV -- Differences between  version  2.4  and
  2812.                3.0 ..............................................   44
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.                             - Pine Technical Notes -
  2825.  
  2826.  
  2827.           (Note: This is not intended to be a complete document,  only
  2828.           helpful notes)
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.                                      - 48 -
  2883.  
  2884.